[Cmake-commits] [cmake-commits] hoffman committed cmCTestRunTest.cxx 1.29 1.30 cmCTestTestHandler.cxx 1.127 1.128

cmake-commits at cmake.org cmake-commits at cmake.org
Wed Dec 2 16:37:45 EST 2009


Update of /cvsroot/CMake/CMake/Source/CTest
In directory public:/mounts/ram/cvs-serv28860/CTest

Modified Files:
	cmCTestRunTest.cxx cmCTestTestHandler.cxx 
Log Message:
Hanle the case where a test can not be run because it is a bad executable.


Index: cmCTestTestHandler.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CTest/cmCTestTestHandler.cxx,v
retrieving revision 1.127
retrieving revision 1.128
diff -C 2 -d -r1.127 -r1.128
*** cmCTestTestHandler.cxx	30 Nov 2009 21:08:10 -0000	1.127
--- cmCTestTestHandler.cxx	2 Dec 2009 21:37:43 -0000	1.128
***************
*** 690,700 ****
        }
      }
-   it = this->TestList.begin();
    ri = this->TestResults.begin();
    // fill maps
!   for(; it != this->TestList.end(); ++it, ++ri)
      {
!     cmCTestTestProperties& p = *it;
!     cmCTestTestResult &result = *ri;
      if(p.Labels.size() != 0)
        {
--- 690,699 ----
        }
      }
    ri = this->TestResults.begin();
    // fill maps
!   for(; ri != this->TestResults.end(); ++ri)
      {
!     cmCTestTestResult &result = *ri; 
!     cmCTestTestProperties& p = *result.Properties;
      if(p.Labels.size() != 0)
        {

Index: cmCTestRunTest.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CTest/cmCTestRunTest.cxx,v
retrieving revision 1.29
retrieving revision 1.30
diff -C 2 -d -r1.29 -r1.30
*** cmCTestRunTest.cxx	30 Nov 2009 21:09:00 -0000	1.29
--- cmCTestRunTest.cxx	2 Dec 2009 21:37:43 -0000	1.30
***************
*** 178,187 ****
        }
      }
-   else // if ( res == cmsysProcess_State_Error )
-     {
-     cmCTestLog(this->CTest, HANDLER_OUTPUT, "***Bad command " << res );
-     this->TestResult.Status = cmCTestTestHandler::BAD_COMMAND;
-     }
- 
    passed = this->TestResult.Status == cmCTestTestHandler::COMPLETED;
    char buf[1024];
--- 178,181 ----
***************
*** 259,262 ****
--- 253,258 ----
        << std::endl << std::endl;
      }
+   // if the test actually stared and ran 
+   // record the results in TestResult 
    if(started)
      {
***************
*** 265,272 ****
      this->TestResult.CompletionStatus = "Completed";
      this->TestResult.ExecutionTime = this->TestProcess->GetTotalTime();
-     this->TestHandler->TestResults.push_back(this->TestResult);
- 
      this->MemCheckPostProcess();
      }
    delete this->TestProcess;
    return passed;
--- 261,269 ----
      this->TestResult.CompletionStatus = "Completed";
      this->TestResult.ExecutionTime = this->TestProcess->GetTotalTime();
      this->MemCheckPostProcess();
      }
+   // Always push the current TestResult onto the
+   // TestHandler vector
+   this->TestHandler->TestResults.push_back(this->TestResult);
    delete this->TestProcess;
    return passed;
***************
*** 310,315 ****
    this->TestResult.ExecutionTime = 0;
    this->TestResult.ReturnValue = -1;
!   this->TestResult.CompletionStatus = "Not Run";
!   this->TestResult.Status = cmCTestTestHandler::NOT_RUN;
    this->TestResult.TestCount = this->TestProperties->Index;  
    this->TestResult.Name = this->TestProperties->Name;
--- 307,312 ----
    this->TestResult.ExecutionTime = 0;
    this->TestResult.ReturnValue = -1;
!   this->TestResult.CompletionStatus = "Failed to start";
!   this->TestResult.Status = cmCTestTestHandler::BAD_COMMAND;
    this->TestResult.TestCount = this->TestProperties->Index;  
    this->TestResult.Name = this->TestProperties->Name;
***************
*** 319,322 ****
--- 316,321 ----
    if (this->ActualCommand == "")
      {
+     // if the command was not found create a TestResult object
+     // that has that information 
      this->TestProcess = new cmProcess;
      *this->TestHandler->LogFile << "Unable to find executable: " 
***************
*** 326,330 ****
      this->TestResult.Output = "Unable to find executable: " + args[1];
      this->TestResult.FullCommandLine = "";
!     this->TestHandler->TestResults.push_back(this->TestResult);
      return false;
      }
--- 325,330 ----
      this->TestResult.Output = "Unable to find executable: " + args[1];
      this->TestResult.FullCommandLine = "";
!     this->TestResult.CompletionStatus = "Not Run";
!     this->TestResult.Status = cmCTestTestHandler::NOT_RUN;
      return false;
      }



More information about the Cmake-commits mailing list