summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CTestCommandLine/repeat-until-fail-cmake.cmake
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2015-03-05 21:51:10 (GMT)
committerBrad King <brad.king@kitware.com>2015-03-23 13:08:22 (GMT)
commitfde70a1b26e130663cc4c02e0530d3aadc165a41 (patch)
treeeac5b5a1a6cfe1709259430eb22e5f7a7cea48ad /Tests/RunCMake/CTestCommandLine/repeat-until-fail-cmake.cmake
parent56be75b3107b210631919c13496060d648f97b14 (diff)
downloadCMake-fde70a1b26e130663cc4c02e0530d3aadc165a41.zip
CMake-fde70a1b26e130663cc4c02e0530d3aadc165a41.tar.gz
CMake-fde70a1b26e130663cc4c02e0530d3aadc165a41.tar.bz2
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.
Diffstat (limited to 'Tests/RunCMake/CTestCommandLine/repeat-until-fail-cmake.cmake')
-rw-r--r--Tests/RunCMake/CTestCommandLine/repeat-until-fail-cmake.cmake15
1 files changed, 15 insertions, 0 deletions
diff --git a/Tests/RunCMake/CTestCommandLine/repeat-until-fail-cmake.cmake b/Tests/RunCMake/CTestCommandLine/repeat-until-fail-cmake.cmake
new file mode 100644
index 0000000..4654416
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/repeat-until-fail-cmake.cmake
@@ -0,0 +1,15 @@
+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)