diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index 13b20de6b..fe2437d38 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -570,16 +570,16 @@ double cmCTestRunTest::ResolveTimeout() stop_time += 24*60*60; } int stop_timeout = (stop_time - current_time) % (24*60*60); + this->CTest->LastStopTimeout = stop_timeout; - if(stop_timeout <= 0) + if(stop_timeout <= 0 || stop_timeout > this->CTest->LastStopTimeout) { cmCTestLog(this->CTest, ERROR_MESSAGE, "The stop time has been passed. " "Exiting ctest." << std::endl); exit(-1); } -#undef min return timeout == 0 ? stop_timeout : - std::min(timeout, static_cast(stop_timeout)); + (timeout < stop_timeout ? timeout : stop_timeout); } //---------------------------------------------------------------------- diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 9ab881c30..bd69d6c5e 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -311,6 +311,7 @@ cmCTest::cmCTest() this->InteractiveDebugMode = true; this->TimeOut = 0; this->GlobalTimeout = 0; + this->LastStopTimeout = 24 * 60 * 60; this->CompressXMLFiles = false; this->CTestConfigFile = ""; this->ScheduleType = ""; @@ -2580,7 +2581,7 @@ void cmCTest::DetermineNextDayStop() lctime->tm_mon + 1, lctime->tm_mday, this->StopTime.c_str(), - timezone); + tzone_offset); time_t stop_time = curl_getdate(buf, ¤t_time); diff --git a/Source/cmCTest.h b/Source/cmCTest.h index 4b6698544..3d7d1179b 100644 --- a/Source/cmCTest.h +++ b/Source/cmCTest.h @@ -457,6 +457,8 @@ private: double GlobalTimeout; + int LastStopTimeout; + int MaxTestNameWidth; int ParallelLevel;