Browse Source

fix so that ctest is run even with bad cmake result

Ken Martin 22 years ago
parent
commit
d4e3804f4e
1 changed files with 10 additions and 4 deletions
  1. 10 4
      Source/cmCTest.cxx

+ 10 - 4
Source/cmCTest.cxx

@@ -3056,7 +3056,7 @@ int cmCTest::RunConfigurationScript()
   int retVal = 0;
   int retVal = 0;
   bool res; 
   bool res; 
   
   
-  // do an initial cvs update on the src dir
+  // do an initial cvs update as required
   const char *cvsCmd = mf->GetDefinition("CTEST_CVS_COMMAND");
   const char *cvsCmd = mf->GetDefinition("CTEST_CVS_COMMAND");
   if (cvsCmd)
   if (cvsCmd)
     {
     {
@@ -3114,6 +3114,7 @@ int cmCTest::RunConfigurationScript()
   
   
   // do an initial cmake to setup the DartConfig file
   // do an initial cmake to setup the DartConfig file
   const char *cmakeCmd = mf->GetDefinition("CTEST_CMAKE_COMMAND");
   const char *cmakeCmd = mf->GetDefinition("CTEST_CMAKE_COMMAND");
+  int cmakeFailed = 0;
   if (cmakeCmd)
   if (cmakeCmd)
     {
     {
     command = cmakeCmd;
     command = cmakeCmd;
@@ -3127,8 +3128,8 @@ int cmCTest::RunConfigurationScript()
                                           m_Verbose, 0 /*m_TimeOut*/);
                                           m_Verbose, 0 /*m_TimeOut*/);
     if (!res || retVal != 0)
     if (!res || retVal != 0)
       {
       {
-      cmSystemTools::Error("Unable to run cmake");    
-      return -7;
+      // even if this fails continue to the next step
+      cmakeFailed = 1;
       }
       }
     }
     }
   
   
@@ -3141,7 +3142,7 @@ int cmCTest::RunConfigurationScript()
                                         m_Verbose, 0 /*m_TimeOut*/);
                                         m_Verbose, 0 /*m_TimeOut*/);
 
 
   // did something critical fail in ctest
   // did something critical fail in ctest
-  if (!res || 
+  if (!res || cmakeFailed ||
       retVal & CTEST_BUILD_ERRORS)
       retVal & CTEST_BUILD_ERRORS)
     {
     {
     // if we backed up the dirs and the build failed, then restore
     // if we backed up the dirs and the build failed, then restore
@@ -3161,6 +3162,11 @@ int cmCTest::RunConfigurationScript()
       rename(backupSrcDir.c_str(), srcDir);
       rename(backupSrcDir.c_str(), srcDir);
       rename(backupBinDir.c_str(), binDir);
       rename(backupBinDir.c_str(), binDir);
       }
       }
+    if (cmakeFailed)
+      {
+      cmSystemTools::Error("Unable to run cmake");    
+      return -7;
+      }
     cmSystemTools::Error("Unable to run ctest");    
     cmSystemTools::Error("Unable to run ctest");    
     if (!res)
     if (!res)
       {
       {