CTest: Label regexes accumulate when calling ctest_test() multiple times
CMakeLists.txt
:
cmake_minimum_required(VERSION 3.20)
project(test NONE)
include(CTest)
add_test(NAME a COMMAND ${CMAKE_COMMAND} -E true)
set_property(TEST a PROPERTY LABELS a)
add_test(NAME b COMMAND ${CMAKE_COMMAND} -E true)
set_property(TEST b PROPERTY LABELS b)
test.cmake
:
set(CTEST_SOURCE_DIRECTORY <redacted>)
set(CTEST_BINARY_DIRECTORY <redacted>/build)
ctest_start(Experimental)
foreach(i a b)
ctest_test(INCLUDE_LABEL "^${i}")
endforeach()
When you run the test.cmake
dashboard script, the second round of ctest_test()
runs no tests, because the label regex ^a$
is left over from the first round, so it's now looking for tests that match both ^a$
and ^b$
. No such test exists.