Incorrect cyclic CTest configuration doesn't emit error code to the system
Here is simple example of cyclic dependency:
cmake_minimum_required(VERSION 3.7.1)
project(foo)
enable_testing()
add_test(NAME Foo COMMAND "${CMAKE_COMMAND}" -E echo "Foo")
add_test(NAME Boo COMMAND "${CMAKE_COMMAND}" -E echo "Boo")
set_tests_properties(
Foo
PROPERTIES
FIXTURES_CLEANUP B
FIXTURES_REQUIRED A
)
set_tests_properties(
Boo
PROPERTIES
FIXTURES_CLEANUP A
FIXTURES_REQUIRED B
)
The problem is that error message is printed but exit code from CTest is still zero:
> ctest
Error: a cycle exists in the test dependency graph for the test "Foo".
Please fix the cycle and run ctest again.
No tests were found!!!
> echo $?
0