summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2010-10-22 18:31:36 (GMT)
committerDavid Cole <david.cole@kitware.com>2010-10-22 18:31:36 (GMT)
commit1e4fd5fc9cf294400a2d6b07a02368da942187bc (patch)
treedfc5a6eddf24535277bfcf3f3f28a6b72139f0b7 /Tests
parentc81ad34e85fcc18fe8095b01e3b06d2cf1005155 (diff)
downloadCMake-1e4fd5fc9cf294400a2d6b07a02368da942187bc.zip
CMake-1e4fd5fc9cf294400a2d6b07a02368da942187bc.tar.gz
CMake-1e4fd5fc9cf294400a2d6b07a02368da942187bc.tar.bz2
Enable overriding contract test timeout values.
Use a longer value as the default timeout (6 hours). For a per-contract-test timeout value, set ${project}_TEST_TIMEOUT in the project's RunTest.cmake file. To use a longer value for all non-specific contract tests, set a CMake cache variable named CMAKE_CONTRACT_TEST_TIMEOUT_DEFAULT. All timeout values are in seconds. Also, patch up last commit to defer evaluation of ENV{HOME} until EnforceConfig.cmake is included at ctest time. This allows Windows machines to have "\\" characters in the HOME environment variable if they want to.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeLists.txt13
1 files changed, 11 insertions, 2 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index ed12c65..5155858 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -23,7 +23,7 @@ IF(DEFINED ENV{HOME} AND NOT CTEST_NO_TEST_HOME)
SET(TEST_HOME_ENV_CODE "# Fake a user home directory to avoid polluting the real one.
# But provide original ENV{HOME} value in ENV{CTEST_REAL_HOME} for tests that
# need access to the real HOME directory.
-SET(ENV{CTEST_REAL_HOME} \"$ENV{HOME}\")
+SET(ENV{CTEST_REAL_HOME} \"\$ENV{HOME}\")
SET(ENV{HOME} \"${TEST_HOME}\")
")
ENDIF()
@@ -1776,7 +1776,16 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
INCLUDE(Contracts/${project}/RunTest.cmake)
ADD_TEST_MACRO(Contracts.${project}
${${project}_RUN_TEST})
- SET_TESTS_PROPERTIES(Contracts.${project} PROPERTIES TIMEOUT 5400)
+ # Contract test timeout in seconds.
+ # Default to 6 hours.
+ IF(DEFINED ${project}_TEST_TIMEOUT)
+ SET(timeout ${${project}_TEST_TIMEOUT})
+ ELSEIF(CMAKE_CONTRACT_TEST_TIMEOUT_DEFAULT)
+ SET(timeout ${CMAKE_CONTRACT_TEST_TIMEOUT_DEFAULT})
+ ELSE()
+ SET(timeout 21600)
+ ENDIF()
+ SET_TESTS_PROPERTIES(Contracts.${project} PROPERTIES TIMEOUT ${timeout})
ENDFOREACH()
ENDIF(BUILD_TESTING)