I think there’s a documentation bug for CTEST_CUSTOM_TESTS_IGNORE
. The documentation says it uses regular expressions, but this does not seem to be the case.
ctest -N
Test project /home/vagrant/Projects/cxxscratch/build/GCC-Debug
Test #1: CxxMain
Test #2: CxxMain.memcheck
Test #3: CMain
Total Tests: 3
When I create a ${CMAKE_BINARY_DIR}/CTestCustom.cmake
with the following content
set(CTEST_CUSTOM_TESTS_IGNORE
".*CxxMain.*"
)
and run cmake --build . --target test
, the CxxMain
tests are still executed
cmake --build . --target test
[0/1] Running tests...
Test project /home/vagrant/Documents/cxxscratch/build/GCC-Debug
Start 1: CxxMain
1/3 Test #1: CxxMain .......................... Passed 0.00 sec
Start 2: CxxMain.memcheck
2/3 Test #2: CxxMain.memcheck ................. Passed 0.01 sec
Start 3: CMain
3/3 Test #3: CMain ............................ Passed 0.00 sec
100% tests passed, 0 tests failed out of 3
Total Test time (real) = 0.02 sec
It doesn’t seem to accept GLOBs either. It does work if you match the test names explicitly. I personally would gladly welcome a change to use regex, but the docs at least should maybe be updated. Thanks!