Am Dienstag, 22. März 2016 um 15:12:36, schrieb Guenter Milde 
<mi...@users.sf.net>
> Dear Kornel and Scott,
>
> On 2016-03-20, Kornel Benko wrote:
> > Am 20. März 2016 um 17:43:47, schrieb Guenter Milde <mi...@users.sf.net>
>
> ...
>
> >> The following simple patch allows to specify all three cases:
>
> >> a) "words" joined by '_' -> one label (or sublabel)
>
> >> b) "words" joined by ':' -> label + subordinate label
>
> >> c) "words" separated with any <separator> -> independent labels (same 
> >> depth)
>
> ...
>
> > You forgot the lines 209 and 240 in ExportTests.cmake, but yes.
>
> Added. Do you think the patches below could go in?

Modified patch for ExportTests.cmake attached
(Use a string to specify allowed chars in a label)
+1 for the other ones.

        Kornel

Attachment: signature.asc
Description: This is a digitally signed message part.

diff --git a/development/autotests/ExportTests.cmake b/development/autotests/ExportTests.cmake
index 2b84dd7..fb4d72f 100644
--- a/development/autotests/ExportTests.cmake
+++ b/development/autotests/ExportTests.cmake
@@ -38,6 +38,9 @@ endif()
 
 set(potential_languages "ca" "cs" "da" "de" "el" "es" "eu" "fa" "fr" "gl" "he" "hu" "id" "it" "ja" "ko" "nb" "nl" "pl" "pt" "ro" "ru" "sk" "sl" "sr" "sv" "uk" "zh_CN")
 
+# Used to select labels from .*Tests files
+set(label_chars "[a-zA-Z]+")
+
 macro(initLangVars varname)
   foreach(_l ${potential_languages})
     set(${varname}_${_l})
@@ -80,7 +83,7 @@ macro(findexpr found testname listname rsublabel)
     if ("${_itrx}" MATCHES "^Sublabel:")
       set(tmpsublabel "")
       string(REGEX REPLACE "^Sublabel:[ \t]*" "" _itrlabels ${_itrx})
-      string(REGEX MATCHALL "[a-zA-Z]+" _labels ${_itrlabels})
+      string(REGEX MATCHALL ${label_chars} _labels ${_itrlabels})
       foreach(subl ${_labels})
         if (subl STREQUAL "RESET")
           set(tmpsublabel "")
@@ -108,7 +111,13 @@ endmacro()
 
 function(join rvalues glue routput)
   set(locallist ${${rvalues}})
-  list(REMOVE_ITEM locallist "export" "lyx2lyx" "load")
+  set(removelist "export" "lyx2lyx" "load")
+  foreach(_l ${locallist})
+    if (depth_${_l} LESS 0)
+      list(APPEND removelist ${_l})
+    endif()
+  endforeach()
+  list(REMOVE_ITEM locallist ${removelist})
   string(REGEX REPLACE "([^\\]|^);" "\\1${glue}" out "${locallist}")
   set(${routput} ${out} PARENT_SCOPE)
 endfunction()
@@ -200,7 +209,7 @@ macro(loadTestList filename resList depth)
       list(APPEND ${resList} "${_newl}")
       if (_newl MATCHES "^Sublabel:")
         string(REGEX REPLACE "^Sublabel:[ \t]*" "" _newlabels ${_newl})
-        string(REGEX MATCHALL "([0-9]*[a-zA-Z]+)" _labels ${_newlabels})
+        string(REGEX MATCHALL "([0-9]*${label_chars})" _labels ${_newlabels})
         foreach(labname ${_labels})
           if (NOT labname STREQUAL "RESET")
             list(APPEND mylabels ${labname})
@@ -231,7 +240,7 @@ macro(loadTestList filename resList depth)
     endif()
   endforeach()
   foreach(_l1 ${mylabels})
-    if (_l1 MATCHES "^([0-9]+)([a-zA-Z]+)$")
+    if (_l1 MATCHES "^([0-9]+)(${label_chars})$")
       set(_l ${CMAKE_MATCH_2})
       set(depth1 ${CMAKE_MATCH_1})
     else()
@@ -265,7 +274,7 @@ endmacro()
 assignLabelDepth(0 "export" "key" "layout" "load" "lyx2lyx" "module" "roundtrip" "url")
 assignLabelDepth(1 "unreliable" "inverted")
 assignLabelDepth(2 "suspended")
-assignLabelDepth(3 "examples" "manuals" "mathmacros" "templates" "autotests")
+assignLabelDepth(-1 "examples" "manuals" "mathmacros" "templates" "autotests")
 
 loadTestList(suspiciousTests suspiciousTests 7)
 loadTestList(ignoredTests ignoredTests 0)

Reply via email to