Skip to content

Commit

Permalink
build: make test timeout configurable
Browse files Browse the repository at this point in the history
The CMake test property TIMEOUT has higher priority than the
user-supplied --timeout switch. The exceptionally long default
setting (1000 seconds) can make tests that aren't entirely controlled
by test-monitor very painful to run.

This commit instead sets CTEST_TEST_TIMEOUT, allowing the user to
override the timeout at test run time.
  • Loading branch information
Bob131 authored and rocallahan committed Aug 11, 2021
1 parent 4857fd6 commit 92d37f3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1566,10 +1566,11 @@ if(BUILD_TESTS)
set(TEST_MONITOR_DEFAULT_TIMEOUT 120)
endif()

# The real timeouts are handled by test-monitor
set(CTEST_TEST_TIMEOUT 1000)

function(configure_test test)
# The real timeouts are handled by test-monitor
set_tests_properties(${test}
PROPERTIES FAIL_REGULAR_EXPRESSION "FAILED" TIMEOUT 1000)
set_tests_properties(${test} PROPERTIES FAIL_REGULAR_EXPRESSION "FAILED")
endfunction(configure_test)

if(INSTALL_TESTSUITE)
Expand Down

0 comments on commit 92d37f3

Please sign in to comment.