[Cmake-commits] [cmake-commits] zach.mullen committed cmCTestMultiProcessHandler.h 1.6 1.7 cmCTestRunTest.cxx 1.8 1.9 cmCTestRunTest.h 1.5 1.6 cmCTestTestHandler.cxx 1.109 1.110

cmake-commits at cmake.org cmake-commits at cmake.org
Mon Aug 31 09:50:37 EDT 2009


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

Modified Files:
	cmCTestMultiProcessHandler.h cmCTestRunTest.cxx 
	cmCTestRunTest.h cmCTestTestHandler.cxx 
Log Message:
Fixed conversion warning on 64 bit machines


Index: cmCTestMultiProcessHandler.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CTest/cmCTestMultiProcessHandler.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C 2 -d -r1.6 -r1.7
*** cmCTestMultiProcessHandler.h	28 Aug 2009 15:08:39 -0000	1.6
--- cmCTestMultiProcessHandler.h	31 Aug 2009 13:50:31 -0000	1.7
***************
*** 82,88 ****
    TestMap Tests;
    //Total number of tests we'll be running
!   int Total;
    //Number of tests that are complete
!   int Completed;
    //list of test properties (indices concurrent to the test map)
    PropertiesMap Properties;
--- 82,88 ----
    TestMap Tests;
    //Total number of tests we'll be running
!   size_t Total;
    //Number of tests that are complete
!   size_t Completed;
    //list of test properties (indices concurrent to the test map)
    PropertiesMap Properties;

Index: cmCTestTestHandler.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CTest/cmCTestTestHandler.cxx,v
retrieving revision 1.109
retrieving revision 1.110
diff -C 2 -d -r1.109 -r1.110
*** cmCTestTestHandler.cxx	28 Aug 2009 19:08:03 -0000	1.109
--- cmCTestTestHandler.cxx	31 Aug 2009 13:50:35 -0000	1.110
***************
*** 710,1028 ****
      }
  }
- /*
- //----------------------------------------------------------------------
- void cmCTestTestHandler::ProcessOneTest(cmCTestTestProperties *it,
-                                         std::vector<cmStdString> &passed,
-                                         std::vector<cmStdString> &failed,
-                                         int cnt, int tmsize)
- {
-   const std::string& testname = it->Name;
-   std::vector<std::string>& args = it->Args;
-   cmCTestTestResult cres;
-   cres.Properties = &*it;
-   cres.ExecutionTime = 0;
-   cres.ReturnValue = -1;
-   cres.Status = cmCTestTestHandler::NOT_RUN;
-   cres.TestCount = cnt;  
-   cres.Name = testname;
-   cres.Path = it->Directory.c_str();
-   
-   cmCTestLog(this->CTest, HANDLER_OUTPUT, std::setw(3) << cnt << "/");
-   cmCTestLog(this->CTest, HANDLER_OUTPUT, std::setw(3) << tmsize << " ");
-   if ( this->MemCheck )
-     {
-     cmCTestLog(this->CTest, HANDLER_OUTPUT, "Memory Check");
-     }
-   else
-     {
-     cmCTestLog(this->CTest, HANDLER_OUTPUT, "Testing");
-     }
-   cmCTestLog(this->CTest, HANDLER_OUTPUT, " ");
-   const int maxTestNameWidth = this->CTest->GetMaxTestNameWidth();
-   std::string outname = testname + " ";
-   outname.resize(maxTestNameWidth, '.');
-   *this->LogFile << cnt << "/" << tmsize << " Testing: " << testname
-                  << std::endl;
-   
-   if ( this->CTest->GetShowOnly() )
-     {
-     cmCTestLog(this->CTest, HANDLER_OUTPUT, outname.c_str() << std::endl);
-     }
-   else
-     {
-     cmCTestLog(this->CTest, HANDLER_OUTPUT, outname.c_str());
-     }
-   
-   cmCTestLog(this->CTest, DEBUG, "Testing " << args[0].c_str() << " ... ");
-   // find the test executable
-   std::string actualCommand = this->FindTheExecutable(args[1].c_str());
-   std::string testCommand
-     = cmSystemTools::ConvertToOutputPath(actualCommand.c_str());
-   
-   // continue if we did not find the executable
-   if (testCommand == "")
-     {
-     *this->LogFile << "Unable to find executable: " << args[1].c_str()
-                    << std::endl;
-     cmCTestLog(this->CTest, ERROR_MESSAGE, "Unable to find executable: "
-                << args[1].c_str() << std::endl);
-     cres.Output = "Unable to find executable: " + args[1];
-     if ( !this->CTest->GetShowOnly() )
-       {
-       cres.FullCommandLine = actualCommand;
-       this->TestResults.push_back( cres );
-       failed.push_back(testname);
-       return;
-       }
-     }
-   
-   // add the arguments
-   std::vector<std::string>::const_iterator j = args.begin();
-   ++j; // skip test name
-   ++j; // skip command as it is in actualCommand
-   std::vector<const char*> arguments;
-   this->GenerateTestCommand(arguments);
-   arguments.push_back(actualCommand.c_str());
-   for(;j != args.end(); ++j)
-     {
-     testCommand += " ";
-     testCommand += cmSystemTools::EscapeSpaces(j->c_str());
-     arguments.push_back(j->c_str());
-     }
-   arguments.push_back(0);
-   
-   std::string output;
-   int retVal = 0;
-   
-   cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, std::endl
-              << (this->MemCheck?"MemCheck":"Test") 
-              << " command: " << testCommand
-              << std::endl);
-   *this->LogFile << cnt << "/" << tmsize
-                  << " Test: " << testname.c_str() << std::endl;
-   *this->LogFile << "Command: ";
-   std::vector<cmStdString>::size_type ll;
-   for ( ll = 0; ll < arguments.size()-1; ll ++ )
-     {
-     *this->LogFile << "\"" << arguments[ll] << "\" ";
-     }
-   *this->LogFile
-     << std::endl
-     << "Directory: " << it->Directory << std::endl
-     << "\"" << testname.c_str() << "\" start time: "
-     << this->CTest->CurrentTime() << std::endl
-     << "Output:" << std::endl
-     << "----------------------------------------------------------"
-     << std::endl;
-   int res = 0;
-   double clock_start, clock_finish;
-   clock_start = cmSystemTools::GetTime();
-   
-   if ( !this->CTest->GetShowOnly() )
-     {
-     res = this->CTest->RunTest(arguments, &output, &retVal, this->LogFile,
-                                it->Timeout, &it->Environment);
-     }
- 
-   clock_finish = cmSystemTools::GetTime();
-   
-   cres.ExecutionTime = (double)(clock_finish - clock_start);
-   cres.FullCommandLine = testCommand;
-   std::string reason;
-   if ( !this->CTest->GetShowOnly() )
-     {
-     std::vector<std::pair<cmsys::RegularExpression,
-       std::string> >::iterator passIt;
-     bool forceFail = false;
-     if ( it->RequiredRegularExpressions.size() > 0 )
-       {
-       bool found = false;
-       for ( passIt = it->RequiredRegularExpressions.begin();
-             passIt != it->RequiredRegularExpressions.end();
-             ++ passIt )
-         {
-         if ( passIt->first.find(output.c_str()) )
-           {
-           found = true;
-           reason = "Required regular expression found.";
-           }
-         }
-       if ( !found )
-         { 
-         reason = "Required regular expression not found.";
-         forceFail = true;
-         }
-       reason +=  "Regex=["; 
-       for ( passIt = it->RequiredRegularExpressions.begin();
-             passIt != it->RequiredRegularExpressions.end();
-             ++ passIt )
-         {
-         reason += passIt->second;
-         reason += "\n";
-         }
-       reason += "]";
-       }
-     if ( it->ErrorRegularExpressions.size() > 0 )
-       {
-       for ( passIt = it->ErrorRegularExpressions.begin();
-             passIt != it->ErrorRegularExpressions.end();
-             ++ passIt )
-         {
-         if ( passIt->first.find(output.c_str()) )
-           {
-           reason = "Error regular expression found in output.";
-           reason += " Regex=[";
-           reason += passIt->second;
-           reason += "]";
-           forceFail = true;
-           }
-         }
-       }
  
-     if (res == cmsysProcess_State_Exited)
-       {
-       bool success =
-         !forceFail && (retVal == 0 || it->RequiredRegularExpressions.size());
-       if((success && !it->WillFail) || (!success && it->WillFail))
-         {
-         cres.Status = cmCTestTestHandler::COMPLETED;
-         cmCTestLog(this->CTest, HANDLER_OUTPUT,   "   Passed  " );
-         }
-       else
-         {
-         cres.Status = cmCTestTestHandler::FAILED;
-         cmCTestLog(this->CTest, HANDLER_OUTPUT,
-                    "***Failed " << reason );
-         }
-       }
-     else if ( res == cmsysProcess_State_Expired )
-       {
-       cmCTestLog(this->CTest, HANDLER_OUTPUT, "***Timeout");
-       cres.Status = cmCTestTestHandler::TIMEOUT;
-       }
-     else if ( res == cmsysProcess_State_Exception )
-       {
-       cmCTestLog(this->CTest, HANDLER_OUTPUT, "***Exception: ");
-       switch ( retVal )
-         {
-         case cmsysProcess_Exception_Fault:
-           cmCTestLog(this->CTest, HANDLER_OUTPUT, "SegFault");
-           cres.Status = cmCTestTestHandler::SEGFAULT;
-           break;
-         case cmsysProcess_Exception_Illegal:
-           cmCTestLog(this->CTest, HANDLER_OUTPUT, "Illegal");
-           cres.Status = cmCTestTestHandler::ILLEGAL;
-           break;
-         case cmsysProcess_Exception_Interrupt:
-           cmCTestLog(this->CTest, HANDLER_OUTPUT, "Interrupt");
-           cres.Status = cmCTestTestHandler::INTERRUPT;
-           break;
-         case cmsysProcess_Exception_Numerical:
-           cmCTestLog(this->CTest, HANDLER_OUTPUT, "Numerical");
-           cres.Status = cmCTestTestHandler::NUMERICAL;
-           break;
-         default:
-           cmCTestLog(this->CTest, HANDLER_OUTPUT, "Other");
-           cres.Status = cmCTestTestHandler::OTHER_FAULT;
-         }
-       }
-     else // if ( res == cmsysProcess_State_Error )
-       {
-       cmCTestLog(this->CTest, HANDLER_OUTPUT, "***Bad command " << res );
-       cres.Status = cmCTestTestHandler::BAD_COMMAND;
-       }
- 
-     if(cres.Status == cmCTestTestHandler::COMPLETED)
-       {
-       passed.push_back(testname);
-       }
-     else
-       {
-       failed.push_back(testname);
-       }
-     char buf[1024];
-     sprintf(buf, "%6.2f sec", cres.ExecutionTime);
-     cmCTestLog(this->CTest, HANDLER_OUTPUT, buf << "\n" );
-     if (!output.empty() && output.find("<DartMeasurement") != output.npos)
-       {
-       if (this->DartStuff.find(output.c_str()))
-         {
-         std::string dartString = this->DartStuff.match(1);
-         // keep searching and replacing until none are left
-         while (this->DartStuff1.find(output.c_str()))
-           {
-           // replace the exact match for the string
-           cmSystemTools::ReplaceString(output,
-                                        this->DartStuff1.match(1).c_str(), "");
-           }
-         cres.RegressionImages
-           = this->GenerateRegressionImages(dartString);
-         }
-       }
-     }
- 
-   // if this is doing MemCheck then all the output needs to be put into
-   // Output since that it what is parsed to by cmCTestMemCheckHandler
-   if(!this->MemCheck)
-     {
-     if ( cres.Status == cmCTestTestHandler::COMPLETED )
-       {
-       this->CleanTestOutput(output, static_cast<size_t>
-                             (this->CustomMaximumPassedTestOutputSize));
-       }
-     else
-       {
-       this->CleanTestOutput(output, static_cast<size_t>
-                             (this->CustomMaximumFailedTestOutputSize));
-       }
-     }
-   cres.Reason = reason;
-   if ( this->LogFile )
-     {
-     bool pass = true;
-     const char* reasonType = "Test Pass Reason";
-     if(cres.Status != cmCTestTestHandler::COMPLETED &&
-        cres.Status != cmCTestTestHandler::NOT_RUN)
-       {
-       reasonType = "Test Fail Reason";
-       pass = false;
-       }
-     double ttime = clock_finish - clock_start;
-     int hours = static_cast<int>(ttime / (60 * 60));
-     int minutes = static_cast<int>(ttime / 60) % 60;
-     int seconds = static_cast<int>(ttime) % 60;
-     char buffer[100];
-     sprintf(buffer, "%02d:%02d:%02d", hours, minutes, seconds);
-     *this->LogFile
-       << "----------------------------------------------------------"
-       << std::endl;
-     if(cres.Reason.size())
-       {
-       *this->LogFile << reasonType << ":\n" << cres.Reason << "\n";
-       }
-     else 
-       {
-       if(pass)
-         {
-         *this->LogFile << "Test Passed.\n";
-         }
-       else
-         {
-         *this->LogFile << "Test Failed.\n";
-         }
-       }
-     *this->LogFile << "\"" << testname.c_str() << "\" end time: "
-       << this->CTest->CurrentTime() << std::endl
-       << "\"" << testname.c_str() << "\" time elapsed: "
-       << buffer << std::endl
-       << "----------------------------------------------------------"
-       << std::endl << std::endl;
-     }
-   cres.Output = output;
-   cres.ReturnValue = retVal;
-   cres.CompletionStatus = "Completed";
-   this->TestResults.push_back( cres );
- }
- */
  //----------------------------------------------------------------------
  void cmCTestTestHandler::CheckLabelFilterInclude(cmCTestTestProperties& it)
--- 710,714 ----

Index: cmCTestRunTest.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CTest/cmCTestRunTest.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C 2 -d -r1.5 -r1.6
*** cmCTestRunTest.h	28 Aug 2009 19:08:03 -0000	1.5
--- cmCTestRunTest.h	31 Aug 2009 13:50:34 -0000	1.6
***************
*** 57,61 ****
    bool StartTest();
    //capture and report the test results
!   bool EndTest(int completed, int total);
    //Called by ctest -N to log the command string
    void ComputeArguments();
--- 57,61 ----
    bool StartTest();
    //capture and report the test results
!   bool EndTest(size_t completed, size_t total);
    //Called by ctest -N to log the command string
    void ComputeArguments();
***************
*** 64,68 ****
    bool CreateProcess(double testTimeOut,
                       std::vector<std::string>* environment);
!   void WriteLogOutputTop(int completed, int total);
    //Run post processing of the process output for MemCheck
    void MemCheckPostProcess();
--- 64,68 ----
    bool CreateProcess(double testTimeOut,
                       std::vector<std::string>* environment);
!   void WriteLogOutputTop(size_t completed, size_t total);
    //Run post processing of the process output for MemCheck
    void MemCheckPostProcess();

Index: cmCTestRunTest.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CTest/cmCTestRunTest.cxx,v
retrieving revision 1.8
retrieving revision 1.9
diff -C 2 -d -r1.8 -r1.9
*** cmCTestRunTest.cxx	30 Aug 2009 14:57:30 -0000	1.8
--- cmCTestRunTest.cxx	31 Aug 2009 13:50:33 -0000	1.9
***************
*** 57,61 ****
  
  //---------------------------------------------------------
! bool cmCTestRunTest::EndTest(int completed, int total)
  {
    //restore the old environment
--- 57,61 ----
  
  //---------------------------------------------------------
! bool cmCTestRunTest::EndTest(size_t completed, size_t total)
  {
    //restore the old environment
***************
*** 428,432 ****
  }
  
! void cmCTestRunTest::WriteLogOutputTop(int completed, int total)
  {
    /* Not sure whether we want to prepend the test index anymore
--- 428,432 ----
  }
  
! void cmCTestRunTest::WriteLogOutputTop(size_t completed, size_t total)
  {
    /* Not sure whether we want to prepend the test index anymore



More information about the Cmake-commits mailing list