Add option to set test timeout

Some tests take 20 or more minutes to run before they timeout, this allows
to limit their runtime if needed.
This commit is contained in:
Maxim Biro 2016-10-04 12:48:24 -04:00
parent b8b9789a69
commit ac8fb636a1

View File

@ -251,6 +251,8 @@ target_link_modules(toxencryptsave toxcore)
#
################################################################################
set(TEST_TIMEOUT_SECONDS "" CACHE STRING "Limit runtime of each test to the number of seconds specified")
if(APIDSL AND ASTYLE)
add_test(
NAME format_test
@ -258,6 +260,7 @@ if(APIDSL AND ASTYLE)
"${CMAKE_SOURCE_DIR}"
"${APIDSL}"
"${ASTYLE}")
set_tests_properties(format_test PROPERTIES TIMEOUT "${TEST_TIMEOUT_SECONDS}")
endif()
function(auto_test target)
@ -271,6 +274,7 @@ function(auto_test target)
target_link_modules(auto_${target}_test toxav)
endif()
add_test(NAME ${target} COMMAND auto_${target}_test)
set_tests_properties(${target} PROPERTIES TIMEOUT "${TEST_TIMEOUT_SECONDS}")
endif()
endfunction()