summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-cmake.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-10-29 18:21:38 (GMT)
committerBrad King <brad.king@kitware.com>2019-10-29 19:14:36 (GMT)
commit39ac8b4eb5c5ea99cf1053bd37e76d811f5122fc (patch)
tree284a7da62ff3285b1809618e822dd1c693ec03dd /Tests/RunCMake/CTestCommandLine/repeat-after-timeout-cmake.cmake
parent80c2c9d14cf1c1a8f162e119bd00d5f483a94af2 (diff)
downloadCMake-39ac8b4eb5c5ea99cf1053bd37e76d811f5122fc.zip
CMake-39ac8b4eb5c5ea99cf1053bd37e76d811f5122fc.tar.gz
CMake-39ac8b4eb5c5ea99cf1053bd37e76d811f5122fc.tar.bz2
ctest: Add --repeat-after-timeout option
Add an option to re-run tests if they timeout. This will help tolerate sporadic timeouts on busy machines.
Diffstat (limited to 'Tests/RunCMake/CTestCommandLine/repeat-after-timeout-cmake.cmake')
-rw-r--r--Tests/RunCMake/CTestCommandLine/repeat-after-timeout-cmake.cmake15
1 files changed, 15 insertions, 0 deletions
diff --git a/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-cmake.cmake b/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-cmake.cmake
new file mode 100644
index 0000000..4dc9c36
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-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-timeout.cmake")
+set_tests_properties(test1 PROPERTIES DEPENDS "initialization" TIMEOUT 2)
+
+add_test(hello ${CMAKE_COMMAND} -E echo hello)
+add_test(goodbye ${CMAKE_COMMAND} -E echo goodbye)