diff options
author | Maxim Biro <nurupo.contributions@gmail.com> | 2016-10-04 12:48:24 -0400 |
---|---|---|
committer | Maxim Biro <nurupo.contributions@gmail.com> | 2016-10-04 12:48:24 -0400 |
commit | ac8fb636a13b22a038b2d9e9805711898125804b (patch) | |
tree | 0a358b8ebc6e5ac8afef3ac69ff0ec6208c0f70f | |
parent | b8b9789a6975266433904b0ab4d381a9f3317986 (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.txt | 4 |
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 | ||
254 | set(TEST_TIMEOUT_SECONDS "" CACHE STRING "Limit runtime of each test to the number of seconds specified") | ||
255 | |||
254 | if(APIDSL AND ASTYLE) | 256 | if(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}") | ||
261 | endif() | 264 | endif() |
262 | 265 | ||
263 | function(auto_test target) | 266 | function(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() |
275 | endfunction() | 279 | endfunction() |
276 | 280 | ||