From 90352f87e1b8d5cc4efdd17da053249b7eea2fe5 Mon Sep 17 00:00:00 2001 From: Bob131 Date: Fri, 11 Jun 2021 12:47:23 +1000 Subject: [PATCH] build: make test timeout configurable 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. --- CMakeLists.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e19fb159ac3..6e7d455a40f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1538,10 +1538,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)