]> git.lyx.org Git - features.git/commitdiff
Cmake export tests: Correct some mistakes in commit 4138ab7
authorKornel Benko <kornel@lyx.org>
Sat, 28 Nov 2015 08:30:49 +0000 (09:30 +0100)
committerKornel Benko <kornel@lyx.org>
Sat, 28 Nov 2015 08:30:49 +0000 (09:30 +0100)
development/autotests/ExportTests.cmake

index ea57434bb2ded848c555a8505029dcd1d26c3856..8a9c0b9c495996551952e060d86f7921a846c6f0 100644 (file)
@@ -173,40 +173,42 @@ macro(loadTestList filename resList)
   set(${resList})
   set(sublabel)
   set(mylabels "")
+  set(languages "")
+  message(STATUS "Reading list ${filename}")
   foreach(_l ${tempList})
     set(_newl "${_l}")
     string(REGEX REPLACE "[ \t]*#.*$" "" _newl "${_l}")
     if(_newl)
-      string(REGEX REPLACE "(\\/|\\||\\(|\\))" "  " _vxx ${_newl})
-      string(REGEX MATCHALL " ([a-z][a-z](_[A-Z][A-Z])?) " _vx ${_vxx})
+      list(APPEND ${resList} "${_newl}")
       if (_newl MATCHES "^Sublabel:")
         string(REGEX REPLACE "^Sublabel:[ \t]*" "" _newlabels ${_newl})
         string(REGEX MATCHALL "([a-zA-Z]+)" _labels ${_newlabels})
         foreach(labname ${_labels})
           if (NOT labname STREQUAL "RESET")
-            list(REMOVE_ITEM mylabels ${labname})
             list(APPEND mylabels ${labname})
           endif()
         endforeach()
+        list(REMOVE_DUPLICATES mylabels)
         set(sublabel ${_newl})
-      endif()
-      if(_vx)
-        foreach(_v ${_vx})
-          string(REGEX REPLACE " " "" _v ${_v})
-          #message(STATUS " ==> ${resList}_${_v}")
-          if (NOT ${sublabel} STREQUAL "${sublabel}_${_v}")
-            list(APPEND ${resList}_${_v} "${sublabel}")
-            set(${sublabel}_${_v} "${sublabel}")
-          endif()
-          list(APPEND ${resList}_${_v} "${_newl}")
-        endforeach()
-        if(_newl MATCHES "\\(\\|")
-          #message(STATUS " ==> ${resList}")
-          list(APPEND ${resList} "${_newl}")
-        endif()
       else()
-        #message(STATUS " ==> ${resList}")
-        list(APPEND ${resList} "${_newl}")
+        string(REGEX REPLACE "(\\/|\\||\\(|\\))" "  " _vxx ${_newl})
+        string(REGEX MATCHALL " ([a-z][a-z](_[A-Z][A-Z])?) " _vx ${_vxx})
+        if(_vx)
+          foreach(_v ${_vx})
+            string(REGEX REPLACE " " "" _v ${_v})
+            #message(STATUS " ==> ${resList}_${_v}")
+            #message(STATUS "sublabel = ${sublabel}, sublabel_${_v} = ${sublabel_${_v}}")
+            if (NOT sublabel STREQUAL "${sublabel_${_v}}")
+              list(APPEND ${resList}_${_v} "${sublabel}")
+              set(sublabel_${_v} "${sublabel}")
+              #message(STATUS "Setting variable sublabel_${_v} with \"${sublabel}\"")
+            endif()
+            list(APPEND ${resList}_${_v} "${_newl}")
+            list(APPEND languages ${_v})
+          endforeach()
+          list(REMOVE_DUPLICATES languages)
+          #message(STATUS "languages = ${languages}")
+        endif()
       endif()
     endif()
   endforeach()
@@ -218,6 +220,11 @@ macro(loadTestList filename resList)
       list(APPEND known_labels ${_l})
     endif()
   endforeach()
+  foreach(_lg ${languages})
+    # reset label for each used language string at end of file
+    #message(STATUS "Resetting variable sublabel_${_lg}, previously set to ${sublabel_${_lg}}")
+    set(sublabel_${_lg} "")
+  endforeach()
 endmacro()
 
 loadTestList(revertedTests revertedTests)