Parcourir la source

Better detection of stop_time being passed.

Zach Mullen il y a 15 ans
Parent
commit
4b32ee01f2
3 fichiers modifiés avec 7 ajouts et 4 suppressions
  1. 3 3
      Source/CTest/cmCTestRunTest.cxx
  2. 2 1
      Source/cmCTest.cxx
  3. 2 0
      Source/cmCTest.h

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

+ 2 - 1
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, &current_time);
 

+ 2 - 0
Source/cmCTest.h

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