Better detection of stop_time being passed.

This commit is contained in:
Zach Mullen 2010-03-19 09:08:57 -04:00
parent 40cb9c89d7
commit 4b32ee01f2
3 changed files with 7 additions and 4 deletions

View File

@ -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<double>(stop_timeout));
(timeout < stop_timeout ? timeout : stop_timeout);
}
//----------------------------------------------------------------------

View File

@ -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, &current_time);

View File

@ -457,6 +457,8 @@ private:
double GlobalTimeout;
int LastStopTimeout;
int MaxTestNameWidth;
int ParallelLevel;