mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 05:16:21 +00:00
Cmake export tests: Check for reused labels included
Labels defined in .*Tests should be unique. Now at least a warning is produced.
This commit is contained in:
parent
e8211fb931
commit
c178c8ab32
@ -143,18 +143,29 @@ macro(maketestname testname reverted listreverted listignored listunreliable lis
|
||||
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)
|
||||
@ -177,12 +188,20 @@ macro(loadTestList filename resList)
|
||||
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}})
|
||||
|
Loading…
Reference in New Issue
Block a user