2013-10-18 19:23:34 +04:00
|
|
|
cmake_minimum_required(VERSION 2.4)
|
2009-09-29 23:18:46 +04:00
|
|
|
|
|
|
|
# Settings:
|
2012-08-13 21:47:32 +04:00
|
|
|
set(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest")
|
|
|
|
set(CTEST_SITE "@SITE@")
|
|
|
|
set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Timeout")
|
2009-09-29 23:18:46 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestTimeout")
|
|
|
|
set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestTimeout")
|
|
|
|
set(CTEST_CVS_COMMAND "@CVSCOMMAND@")
|
2014-03-03 23:06:34 +04:00
|
|
|
set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@")
|
2014-09-05 23:40:01 +04:00
|
|
|
set(CTEST_CMAKE_GENERATOR_PLATFORM "@CMAKE_GENERATOR_PLATFORM@")
|
2014-03-03 23:06:34 +04:00
|
|
|
set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_GENERATOR_TOOLSET@")
|
2012-08-13 21:47:32 +04:00
|
|
|
set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
|
|
|
|
set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@")
|
|
|
|
set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
|
2009-09-29 23:18:46 +04:00
|
|
|
|
|
|
|
#CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY})
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
file(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" "
|
2009-12-02 17:31:49 +03:00
|
|
|
TIMEOUT:STRING=@CTestTestTimeout_TIME@
|
2009-09-29 23:18:46 +04:00
|
|
|
")
|
|
|
|
|
|
|
|
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)
|
2014-05-23 17:47:44 +04:00
|
|
|
|
|
|
|
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()
|
2014-07-02 18:37:42 +04:00
|
|
|
message(STATUS "Log indicates timeout correctly killed child.")
|
2014-05-23 17:47:44 +04:00
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
message(FATAL_ERROR "Log does not exist:\n ${log}")
|
|
|
|
endif()
|