ctest --fixture-exclude-cleanup does not work
The main use case for me here is to avoid fixture clean ups when tests fail (with complex test setup scenarios). This would allow me to debug the problem easily.
While looking through the man page for ctest, I saw the --fixture-exclude-cleanup and similar commands (-FC, -FA, ...) and thought this is exactly what I need.
Using this CMakeLists.txt, I don't see how it works:
cmake_minimum_required (VERSION 3.7)
project (foo)
enable_testing ()
add_test (NAME test_setup COMMAND ${CMAKE_COMMAND} -E echo setup)
add_test (NAME test_cleanup COMMAND ${CMAKE_COMMAND} -E echo cleanup)
add_test (NAME test_foo COMMAND ${CMAKE_COMMAND} -E echo "needs fixture")
set_tests_properties (test_setup PROPERTIES FIXTURES_SETUP FooThings)
set_tests_properties (test_cleanup PROPERTIES FIXTURES_CLEANUP FooThings)
set_tests_properties (test_foo PROPERTIES FIXTURES_REQUIRED FooThings)
I'm trying to run the following:
$ cmake .
...
$ ctest --fixture-exclude-cleanup FooThings
Test project /tmp/ctest
Start 1: test_setup
1/3 Test #1: test_setup ....................... Passed 0.01 sec
Start 2: test_cleanup
2/3 Test #2: test_cleanup ..................... Passed 0.01 sec
Start 3: test_foo
3/3 Test #3: test_foo ......................... Passed 0.01 sec
100% tests passed, 0 tests failed out of 3
Total Test time (real) = 0.03 sec
If this was working, I would expect to see no test_cleanup
at all.
Edited by Martyn Russell