2009-12-01 00:31:28 +03:00
|
|
|
cmake_minimum_required (VERSION 2.8)
|
2009-09-29 23:18:46 +04:00
|
|
|
PROJECT(CTestTestTimeout)
|
2009-12-02 17:16:29 +03:00
|
|
|
INCLUDE(CTest)
|
2009-09-29 23:18:46 +04:00
|
|
|
|
2009-12-02 17:31:49 +03:00
|
|
|
IF(NOT TIMEOUT)
|
2009-12-21 18:00:51 +03:00
|
|
|
IF(CYGWIN)
|
|
|
|
SET(TIMEOUT 4) # Cygwin CMake sometimes takes > 1 second to load!
|
|
|
|
ELSE()
|
|
|
|
SET(TIMEOUT 1)
|
|
|
|
ENDIF()
|
2009-12-02 17:31:49 +03:00
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
ADD_DEFINITIONS(-DTIMEOUT=${TIMEOUT})
|
2009-09-29 23:18:46 +04:00
|
|
|
ADD_EXECUTABLE (Timeout timeout.c)
|
|
|
|
|
2009-12-01 00:31:28 +03:00
|
|
|
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
|
|
|
|
)
|
2009-12-02 17:31:49 +03:00
|
|
|
SET_TESTS_PROPERTIES(TestTimeout PROPERTIES TIMEOUT ${TIMEOUT})
|
2009-09-29 23:18:46 +04:00
|
|
|
|
2009-12-01 00:31:28 +03:00
|
|
|
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)
|