diff options
author | Brad King <brad.king@kitware.com> | 2014-05-23 13:47:44 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-05-23 14:30:39 (GMT) |
commit | 9afcecaf32acb4333b33d46522f98457bfa8856d (patch) | |
tree | c27da3ad5fcafddaf930e517b05c5c392e1e92af /Tests/CTestTestTimeout/test.cmake.in | |
parent | 8ae05b420e513252d1fd68dc6085d8dd92f3e624 (diff) | |
download | CMake-9afcecaf32acb4333b33d46522f98457bfa8856d.zip CMake-9afcecaf32acb4333b33d46522f98457bfa8856d.tar.gz CMake-9afcecaf32acb4333b33d46522f98457bfa8856d.tar.bz2 |
Tests: Try to make CTestTestTimeout more robust
Write to the timeout test log file before sleeping and flush to be sure
it is created. Move the check that the after-sleep line is not written
out to the ctest script. Rename the CheckChild test to TestSleep since
it no longer checks. Do not try to read the log file if it does not
exist.
Diffstat (limited to 'Tests/CTestTestTimeout/test.cmake.in')
-rw-r--r-- | Tests/CTestTestTimeout/test.cmake.in | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Tests/CTestTestTimeout/test.cmake.in b/Tests/CTestTestTimeout/test.cmake.in index 4178849..68c74d8 100644 --- a/Tests/CTestTestTimeout/test.cmake.in +++ b/Tests/CTestTestTimeout/test.cmake.in @@ -24,3 +24,16 @@ CTEST_START(Experimental) CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) + +set(log ${CTEST_BINARY_DIRECTORY}/timeout.log) +if(EXISTS "${log}") + # Verify that the timeout test did not finish sleeping. + file(STRINGS "${log}" after_sleep REGEX "after sleep") + if(after_sleep) + message(FATAL_ERROR "Log indicates timeout did not kill child.") + else() + message("Log indicates timeout correctly killed child.") + endif() +else() + message(FATAL_ERROR "Log does not exist:\n ${log}") +endif() |