diff options
author | Brad King <brad.king@kitware.com> | 2023-09-29 13:00:30 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-09-29 13:25:01 (GMT) |
commit | d267c128a232e9beb99576f901ee1b9291ba1480 (patch) | |
tree | b017f5ccc4a31087bc41a8d57ce1a7fe13ec1e1f /Source | |
parent | dd779a4bc2f1b845a03b00885cd33ed2cc8adac3 (diff) | |
download | CMake-d267c128a232e9beb99576f901ee1b9291ba1480.zip CMake-d267c128a232e9beb99576f901ee1b9291ba1480.tar.gz CMake-d267c128a232e9beb99576f901ee1b9291ba1480.tar.bz2 |
ctest: Restore support for --timeout values higher than default test timeout
Since refactoring in commit 0a5aeaf302 (cmCTestRunTest: Consolidate test
timeout selection logic, 2023-05-04, v3.27.0-rc1~120^2) we accidentally
truncate `--timeout` values to ctest's default `TimeOut`. Fix the
logic to prefer the flag whenever the `TIMEOUT` property is not set.
In combination with the prior refactoring, this also fixes a bug that
caused `--timeout` values of 10000000 seconds or more to be ignored.
Fixes: #23979
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CTest/cmCTestRunTest.cxx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index 563439a..19e505f 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -768,11 +768,12 @@ bool cmCTestRunTest::ForkProcess() timeout = this->CTest->GetGlobalTimeout(); } - // Check CTEST_TEST_TIMEOUT. - cmDuration ctestTestTimeout = this->CTest->GetTimeOut(); - if (ctestTestTimeout > cmDuration::zero() && - (!timeout || ctestTestTimeout < *timeout)) { - timeout = ctestTestTimeout; + if (!timeout) { + // Check CTEST_TEST_TIMEOUT. + cmDuration ctestTestTimeout = this->CTest->GetTimeOut(); + if (ctestTestTimeout > cmDuration::zero()) { + timeout = ctestTestTimeout; + } } } |