CMake/Tests/CTestTestTimeout/CMakeLists.txt
Rolf Eike Beer a73373a8c8 CTestTestTimeout: increase the timeout for all platforms
Slow or busy machines not running Cygwin may also fail the 1 second timeout:

CMake Error at CTestTestTimeout/test.cmake:38 (message):
  Log does not exist:

    .../Tests/CTestTestTimeout/timeout.log

http://open.cdash.org/testDetails.php?test=264045338&build=3382733
http://open.cdash.org/testDetails.php?test=263904235&build=3382056
2014-06-25 17:44:09 +02:00

22 lines
644 B
CMake

cmake_minimum_required (VERSION 2.8)
project(CTestTestTimeout)
include(CTest)
if(NOT TIMEOUT)
# Give the process time to load and start running.
set(TIMEOUT 4)
endif()
add_definitions(-DTIMEOUT=${TIMEOUT})
add_executable (Sleep sleep.c)
add_test(NAME TestTimeout
COMMAND ${CMAKE_COMMAND} -D Sleep=$<TARGET_FILE:Sleep>
-D Log=${CMAKE_CURRENT_BINARY_DIR}/timeout.log
-P ${CMAKE_CURRENT_SOURCE_DIR}/timeout.cmake
)
set_tests_properties(TestTimeout PROPERTIES TIMEOUT ${TIMEOUT})
add_test(NAME TestSleep COMMAND Sleep)
set_tests_properties(TestSleep PROPERTIES DEPENDS TestTimeout)