summaryrefslogtreecommitdiffstats
path: root/Tests/CTestTestTimeout/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-11-30 21:31:28 (GMT)
committerBrad King <brad.king@kitware.com>2009-11-30 21:31:28 (GMT)
commit88eefaced14bee4bffb7f1dd1c5a2aa02bc97101 (patch)
tree5ca0860d163049b5ac50a0c68eea867c1b2fccf9 /Tests/CTestTestTimeout/CMakeLists.txt
parent2aaa96771558799f07b9a8562b69f58cf580b041 (diff)
downloadCMake-88eefaced14bee4bffb7f1dd1c5a2aa02bc97101.zip
CMake-88eefaced14bee4bffb7f1dd1c5a2aa02bc97101.tar.gz
CMake-88eefaced14bee4bffb7f1dd1c5a2aa02bc97101.tar.bz2
CTest: Test process tree kill on timeout
We extend the CTestTestTimeout test to check that when a test times out its children (grandchildren of ctest) are killed. Instead of running the timeout executable directly, we run it through a cmake script that redirects the timeout executable output to a file. A second test later runs and verifies that the timeout executable was unable to complete and write data to the log file. Only if the first inner test times out and the second inner test passes (log is empty) does the CTestTestTimeout test pass.
Diffstat (limited to 'Tests/CTestTestTimeout/CMakeLists.txt')
-rw-r--r--Tests/CTestTestTimeout/CMakeLists.txt16
1 files changed, 14 insertions, 2 deletions
diff --git a/Tests/CTestTestTimeout/CMakeLists.txt b/Tests/CTestTestTimeout/CMakeLists.txt
index 15942c8..ed7f175 100644
--- a/Tests/CTestTestTimeout/CMakeLists.txt
+++ b/Tests/CTestTestTimeout/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required (VERSION 2.6)
+cmake_minimum_required (VERSION 2.8)
PROJECT(CTestTestTimeout)
SET(DART_ROOT "" CACHE STRING "" FORCE)
@@ -12,7 +12,19 @@ ADD_EXECUTABLE (Timeout timeout.c)
ENABLE_TESTING ()
-ADD_TEST (TestTimeout Timeout)
+ADD_TEST(NAME TestTimeout
+ COMMAND ${CMAKE_COMMAND} -D Timeout=$<TARGET_FILE:Timeout>
+ -D Log=${CMAKE_CURRENT_BINARY_DIR}/timeout.log
+ -P ${CMAKE_CURRENT_SOURCE_DIR}/timeout.cmake
+ )
SET_TESTS_PROPERTIES(TestTimeout PROPERTIES TIMEOUT 1)
+ADD_TEST(NAME CheckChild
+ COMMAND ${CMAKE_COMMAND} -D Timeout=$<TARGET_FILE:Timeout>
+ -D Log=${CMAKE_CURRENT_BINARY_DIR}/timeout.log
+ -P ${CMAKE_CURRENT_SOURCE_DIR}/check.cmake
+ )
+SET_TESTS_PROPERTIES(CheckChild PROPERTIES DEPENDS TestTimeout)
+
+
INCLUDE (CTest)