summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Biro <nurupo.contributions@gmail.com>2016-10-04 12:48:24 -0400
committerMaxim Biro <nurupo.contributions@gmail.com>2016-10-04 12:48:24 -0400
commitac8fb636a13b22a038b2d9e9805711898125804b (patch)
tree0a358b8ebc6e5ac8afef3ac69ff0ec6208c0f70f
parentb8b9789a6975266433904b0ab4d381a9f3317986 (diff)
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.
-rw-r--r--CMakeLists.txt4
1 files changed, 4 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9e46741e..f6f74e6a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -251,6 +251,8 @@ target_link_modules(toxencryptsave toxcore)
251# 251#
252################################################################################ 252################################################################################
253 253
254set(TEST_TIMEOUT_SECONDS "" CACHE STRING "Limit runtime of each test to the number of seconds specified")
255
254if(APIDSL AND ASTYLE) 256if(APIDSL AND ASTYLE)
255 add_test( 257 add_test(
256 NAME format_test 258 NAME format_test
@@ -258,6 +260,7 @@ if(APIDSL AND ASTYLE)
258 "${CMAKE_SOURCE_DIR}" 260 "${CMAKE_SOURCE_DIR}"
259 "${APIDSL}" 261 "${APIDSL}"
260 "${ASTYLE}") 262 "${ASTYLE}")
263 set_tests_properties(format_test PROPERTIES TIMEOUT "${TEST_TIMEOUT_SECONDS}")
261endif() 264endif()
262 265
263function(auto_test target) 266function(auto_test target)
@@ -271,6 +274,7 @@ function(auto_test target)
271 target_link_modules(auto_${target}_test toxav) 274 target_link_modules(auto_${target}_test toxav)
272 endif() 275 endif()
273 add_test(NAME ${target} COMMAND auto_${target}_test) 276 add_test(NAME ${target} COMMAND auto_${target}_test)
277 set_tests_properties(${target} PROPERTIES TIMEOUT "${TEST_TIMEOUT_SECONDS}")
274 endif() 278 endif()
275endfunction() 279endfunction()
276 280