CMake/Tests/CTestTestTimeout/CMakeLists.txt

29 lines
899 B
CMake
Raw Normal View History

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