From: Kornel Benko Date: Sat, 26 Mar 2016 12:06:14 +0000 (+0100) Subject: Cmake export tests: Label handling X-Git-Tag: 2.2.0rc1~67 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=41447b12250c704e813e97edae425d1b0467c467;p=features.git Cmake export tests: Label handling In collaboration with Günter Milde: 1.) Allow char ':' be part of a ctest-label 2.) Eliminate redundant label naming and directory names (The testnames should not repeat the directory name) --- diff --git a/development/autotests/ExportTests.cmake b/development/autotests/ExportTests.cmake index 2b84dd7617..e4a65de37c 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) diff --git a/development/cmake/modules/LyXMacros.cmake b/development/cmake/modules/LyXMacros.cmake index a3db752f65..2e2f7d8930 100644 --- a/development/cmake/modules/LyXMacros.cmake +++ b/development/cmake/modules/LyXMacros.cmake @@ -329,7 +329,7 @@ macro(sortlabellist listout) list(APPEND tmplist "${depth_${_lab}}${_lab}") endforeach() list(SORT tmplist) - string(REGEX REPLACE ";[0-9]+" ";" ${listout} ";${tmplist}") + string(REGEX REPLACE ";[-0-9]+" ";" ${listout} ";${tmplist}") endmacro() macro(createlabel reslabel first)