CMake/Tests/RunCMake/CTestCommandLine/repeat-until-fail-cmake.cmake
Bill Hoffman fde70a1b26 ctest: Add a new --repeat-until-fail option
This option tells ctest to run each test N times until the test fails or
the N times have run. This is useful for finding random failing tests.
2015-03-23 09:08:22 -04:00

16 lines
533 B
CMake

enable_testing()
set(TEST_OUTPUT_FILE "${CMAKE_CURRENT_BINARY_DIR}/test_output.txt")
add_test(NAME initialization
COMMAND ${CMAKE_COMMAND}
"-DTEST_OUTPUT_FILE=${TEST_OUTPUT_FILE}"
-P "${CMAKE_CURRENT_SOURCE_DIR}/init.cmake")
add_test(NAME test1
COMMAND ${CMAKE_COMMAND}
"-DTEST_OUTPUT_FILE=${TEST_OUTPUT_FILE}"
-P "${CMAKE_CURRENT_SOURCE_DIR}/test1.cmake")
set_tests_properties(test1 PROPERTIES DEPENDS "initialization")
add_test(hello ${CMAKE_COMMAND} -E echo hello)
add_test(goodbye ${CMAKE_COMMAND} -E echo goodbye)