summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorZack Galbreath <zack.galbreath@kitware.com>2013-09-24 18:20:38 (GMT)
committerBrad King <brad.king@kitware.com>2013-10-08 13:18:13 (GMT)
commiteb2decc02d28f41a3e189d5387be24552c42060f (patch)
treef1995da8fc935d3ed8831213da02534eab5e7ce2 /Tests
parent475635ec0f3eeae9f6db0f9daa8a9c4cd8b3f989 (diff)
downloadCMake-eb2decc02d28f41a3e189d5387be24552c42060f.zip
CMake-eb2decc02d28f41a3e189d5387be24552c42060f.tar.gz
CMake-eb2decc02d28f41a3e189d5387be24552c42060f.tar.bz2
ctest: Add --rerun-failed option
Add a new command line argument to ctest. This allows users to rerun tests that failed during the previous call to ctest. This is accomplished by analyzing the most recently modified file named "^LastTestsFailed*" in the Testing/Temporary subdirectory of the project's binary directory.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeLists.txt10
1 files changed, 10 insertions, 0 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 9c3ed59..d1b1b43 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -2139,6 +2139,16 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
set_tests_properties(CTestTestTimeout PROPERTIES
PASS_REGULAR_EXPRESSION "TestTimeout *\\.+ *\\*\\*\\*Timeout.*CheckChild *\\.+ *Passed")
+ # this test only runs correctly if WORKING_DIRECTORY is honored.
+ if (NOT CMAKE_VERSION VERSION_LESS "2.8.4")
+ add_test(
+ NAME CTestTestRerunFailed
+ COMMAND ${CMAKE_CTEST_COMMAND} --rerun-failed)
+ set_tests_properties(CTestTestRerunFailed PROPERTIES
+ PASS_REGULAR_EXPRESSION "1/1 Test #1: TestTimeout" DEPENDS CTestTestTimeout
+ WORKING_DIRECTORY ${CMake_BINARY_DIR}/Tests/CTestTestTimeout)
+ endif ()
+
configure_file(
"${CMake_SOURCE_DIR}/Tests/CTestTestZeroTimeout/test.cmake.in"
"${CMake_BINARY_DIR}/Tests/CTestTestZeroTimeout/test.cmake"