فهرست منبع

ENH: Add timeout support

Andy Cedilnik 20 سال پیش
والد
کامیت
1e72091e86
2فایلهای تغییر یافته به همراه13 افزوده شده و 0 حذف شده
  1. 12 0
      Source/CTest/cmCTestTestCommand.cxx
  2. 1 0
      Source/cmCTest.h

+ 12 - 0
Source/CTest/cmCTestTestCommand.cxx

@@ -30,6 +30,18 @@ cmCTestTestCommand::cmCTestTestCommand()
 
 cmCTestGenericHandler* cmCTestTestCommand::InitializeHandler()
 {
+  const char* ctestTimeout = m_Makefile->GetDefinition("CTEST_TEST_TIMEOUT");
+  double timeout = m_CTest->GetTimeOut();
+  if ( ctestTimeout )
+    {
+    timeout = atof(ctestTimeout);
+    }
+  else
+    {
+    // By default use timeout of 10 minutes
+    timeout = 600;
+    }
+  m_CTest->SetTimeOut(timeout);
   cmCTestGenericHandler* handler = m_CTest->GetInitializedHandler("test");
   if ( m_Values[ctt_START] || m_Values[ctt_END] || m_Values[ctt_STRIDE] )
     {

+ 1 - 0
Source/cmCTest.h

@@ -92,6 +92,7 @@ public:
   ///! what is the configuraiton type, e.g. Debug, Release etc.
   std::string GetConfigType();
   double GetTimeOut() { return m_TimeOut; }
+  void SetTimeOut(double t) { m_TimeOut = t; }
   
   /**
    * Check if CTest file exists