endif()
endmacro()
+# This labels should not be used in .*Tests files
+set(known_labels "export" "key" "layout" "load" "lyx2lyx"
+ "examples" "manuals" "mathmacros" "reverted" "templates" "unreliable" "suspended"
+ "module" "roundtrip" "url")
+
macro(loadTestList filename resList)
# Create list of strings from a file without comments
file(STRINGS ${filename} tempList ENCODING "UTF-8")
set(${resList})
set(sublabel)
+ set(mylabels "")
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})
- if (_newl MATCHES "^Sublabel:")
+ if (_newl MATCHES "^Sublabel:[ \t]*\([a-zA-Z]+\)")
+ set(labname ${CMAKE_MATCH_1})
+ if (NOT labname STREQUAL "RESET")
+ list(REMOVE_ITEM mylabels ${labname})
+ list(APPEND mylabels ${labname})
+ endif()
set(sublabel ${_newl})
endif()
if(_vx)
endif()
endif()
endforeach()
+ foreach(_l ${mylabels})
+ list(FIND known_labels ${_l} _ff)
+ if (_ff GREATER -1)
+ message(STATUS "Label \"${_l}\" already in use. Reused in ${filename}")
+ else()
+ list(APPEND known_labels ${_l})
+ endif()
+ endforeach()
endmacro()
-loadTestList(revertedTests revertedTests)
-loadTestList(ignoredTests ignoredTests)
-loadTestList(suspendedTests suspendedTests)
-loadTestList(unreliableTests unreliableTests)
+loadTestList(revertedTests revertedTests new_labels)
+loadTestList(ignoredTests ignoredTests new_labels)
+loadTestList(suspendedTests suspendedTests new_labels)
+loadTestList(unreliableTests unreliableTests new_labels)
macro(handlesuspended TestName reverted testlabel)
set(mylabel ${${testlabel}})