summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestRunTest.cxx
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2023-07-24 14:34:31 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2023-07-24 23:29:54 (GMT)
commit0e8584c89cdc8114cf2b037ac3d5a76599733ecf (patch)
treee13aa688ba70e601d0993df83c663696d521f076 /Source/CTest/cmCTestRunTest.cxx
parent21721ad3cea539a0157f77e19add5aa873290fa3 (diff)
downloadCMake-0e8584c89cdc8114cf2b037ac3d5a76599733ecf.zip
CMake-0e8584c89cdc8114cf2b037ac3d5a76599733ecf.tar.gz
CMake-0e8584c89cdc8114cf2b037ac3d5a76599733ecf.tar.bz2
CTest: Fix regression in calculating test timeout
Fixes: #25120
Diffstat (limited to 'Source/CTest/cmCTestRunTest.cxx')
-rw-r--r--Source/CTest/cmCTestRunTest.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx
index 9b62183..563439a 100644
--- a/Source/CTest/cmCTestRunTest.cxx
+++ b/Source/CTest/cmCTestRunTest.cxx
@@ -758,11 +758,13 @@ bool cmCTestRunTest::ForkProcess()
}
// An explicit TIMEOUT=0 test property means "no timeout".
- if (timeout && *timeout == std::chrono::duration<double>::zero()) {
- timeout = cm::nullopt;
+ if (timeout) {
+ if (*timeout == std::chrono::duration<double>::zero()) {
+ timeout = cm::nullopt;
+ }
} else {
// Check --timeout.
- if (!timeout && this->CTest->GetGlobalTimeout() > cmDuration::zero()) {
+ if (this->CTest->GetGlobalTimeout() > cmDuration::zero()) {
timeout = this->CTest->GetGlobalTimeout();
}