[Cmake-commits] [cmake-commits] zach.mullen committed cmCTestMultiProcessHandler.cxx 1.15 1.16 cmCTestMultiProcessHandler.h 1.8 1.9 cmCTestTestHandler.cxx 1.114 1.115 cmProcess.cxx 1.8 1.9

cmake-commits at cmake.org cmake-commits at cmake.org
Fri Sep 4 10:16:08 EDT 2009


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

Modified Files:
	cmCTestMultiProcessHandler.cxx cmCTestMultiProcessHandler.h 
	cmCTestTestHandler.cxx cmProcess.cxx 
Log Message:
Added the test property EXPENSIVE, which denotes that the given test(s) should be started prior to tests that are not marked as such. Also fixed test dependencies, and a few uninitialized variables in cmProcess.


Index: cmCTestMultiProcessHandler.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CTest/cmCTestMultiProcessHandler.cxx,v
retrieving revision 1.15
retrieving revision 1.16
diff -C 2 -d -r1.15 -r1.16
*** cmCTestMultiProcessHandler.cxx	3 Sep 2009 19:33:44 -0000	1.15
--- cmCTestMultiProcessHandler.cxx	4 Sep 2009 14:16:06 -0000	1.16
***************
*** 30,33 ****
--- 30,34 ----
  void 
  cmCTestMultiProcessHandler::SetTests(TestMap& tests,
+                                      TestMap& expensiveTests,
                                       PropertiesMap& properties)
  {
***************
*** 38,45 ****
      this->TestRunningMap[i->first] = false;
      this->TestFinishMap[i->first] = false;
      }
    this->Tests = tests;
!   this->Total = this->Tests.size();
    this->Properties = properties;
  }
  
--- 39,52 ----
      this->TestRunningMap[i->first] = false;
      this->TestFinishMap[i->first] = false;
+ 
+     if(this->Properties[i->first]->Expensive)
+       {
+       this->ExpensiveTests[i->first] = i->second;
+       }
      }
    this->Tests = tests;
!   this->ExpensiveTests = expensiveTests;
    this->Properties = properties;
+   this->Total = this->Tests.size();
  }
  
***************
*** 60,64 ****
    this->TestHandler->SetMaxIndex(this->FindMaxIndex());
    this->StartNextTests();
!   while(this->Tests.size() != 0)
      {
      this->CheckOutput();
--- 67,71 ----
    this->TestHandler->SetMaxIndex(this->FindMaxIndex());
    this->StartNextTests();
!   while(this->Tests.size() != 0 || this->ExpensiveTests.size() != 0)
      {
      this->CheckOutput();
***************
*** 89,92 ****
--- 96,103 ----
    this->TestRunningMap[test] = true; // mark the test as running
    // now remove the test itself
+   if(this->ExpensiveTests.size() > 0)
+     {
+     this->ExpensiveTests.erase(test);
+     }
    this->Tests.erase(test);
    cmCTestRunTest* testRun = new cmCTestRunTest;
***************
*** 140,144 ****
    if(totalDepends == 0)
      {
-     // Start this test it has no depends 
      this->StartTestProcess(test);
      return true;
--- 151,154 ----
***************
*** 151,157 ****
  void cmCTestMultiProcessHandler::StartNextTests()
  {
-   //cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, std::endl
-   //           << "Number of running tests : " << this->RunningTests.size()
-   //           << "\n");
    size_t numToStart = this->ParallelLevel - this->RunningTests.size();
    if(numToStart == 0)
--- 161,164 ----
***************
*** 159,163 ****
      return;
      }
!   TestMap tests = this->Tests;
    for(TestMap::iterator i = tests.begin();
        i !=  tests.end(); ++i)
--- 166,172 ----
      return;
      }
!   TestMap tests = this->ExpensiveTests.size() > 0 ? 
!     this->ExpensiveTests : this->Tests;
! 
    for(TestMap::iterator i = tests.begin();
        i !=  tests.end(); ++i)
***************
*** 219,227 ****
        this->Failed->push_back(p->GetTestProperties()->Name);
        }
      for(TestMap::iterator j = this->Tests.begin();
!        j!=  this->Tests.end(); ++j)
!     {
!     j->second.erase(test);
!     }
      this->TestFinishMap[test] = true;
      this->TestRunningMap[test] = false;
--- 228,241 ----
        this->Failed->push_back(p->GetTestProperties()->Name);
        }
+     for(TestMap::iterator j = this->ExpensiveTests.begin();
+         j != this->ExpensiveTests.end(); ++j)
+       {
+       j->second.erase(test);
+       }
      for(TestMap::iterator j = this->Tests.begin();
!         j != this->Tests.end(); ++j)
!       {
!       j->second.erase(test);
!       }
      this->TestFinishMap[test] = true;
      this->TestRunningMap[test] = false;
***************
*** 324,327 ****
--- 338,342 ----
    this->Tests.erase(index);
    this->Properties.erase(index);
+   this->ExpensiveTests.erase(index);
    this->TestRunningMap[index] = false;
    this->TestFinishMap[index] = true;

Index: cmCTestMultiProcessHandler.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CTest/cmCTestMultiProcessHandler.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -C 2 -d -r1.8 -r1.9
*** cmCTestMultiProcessHandler.h	2 Sep 2009 14:08:39 -0000	1.8
--- cmCTestMultiProcessHandler.h	4 Sep 2009 14:16:06 -0000	1.9
***************
*** 37,41 ****
    cmCTestMultiProcessHandler();
    // Set the tests
!   void SetTests(TestMap& tests, PropertiesMap& properties);
    // Set the max number of tests that can be run at the same time.
    void SetParallelLevel(size_t);
--- 37,42 ----
    cmCTestMultiProcessHandler();
    // Set the tests
!   void SetTests(TestMap& tests, TestMap& expensiveTests,
!                 PropertiesMap& properties);
    // Set the max number of tests that can be run at the same time.
    void SetParallelLevel(size_t);
***************
*** 82,85 ****
--- 83,87 ----
    // map from test number to set of depend tests
    TestMap Tests;
+   TestMap ExpensiveTests;
    //Total number of tests we'll be running
    size_t Total;

Index: cmCTestTestHandler.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CTest/cmCTestTestHandler.cxx,v
retrieving revision 1.114
retrieving revision 1.115
diff -C 2 -d -r1.114 -r1.115
*** cmCTestTestHandler.cxx	3 Sep 2009 15:14:12 -0000	1.114
--- cmCTestTestHandler.cxx	4 Sep 2009 14:16:06 -0000	1.115
***************
*** 1010,1021 ****
      << std::endl;
  
-   cmCTestMultiProcessHandler::TestSet depends;
    cmCTestMultiProcessHandler::TestMap tests;
    cmCTestMultiProcessHandler::PropertiesMap properties;
    for (ListOfTests::iterator it = this->TestList.begin();
         it != this->TestList.end(); it ++ )
      { 
      cmCTestTestProperties& p = *it;
!     
      if(p.Depends.size())
        {
--- 1010,1023 ----
      << std::endl;
  
    cmCTestMultiProcessHandler::TestMap tests;
+   cmCTestMultiProcessHandler::TestMap expensiveTests;
    cmCTestMultiProcessHandler::PropertiesMap properties;
+   
    for (ListOfTests::iterator it = this->TestList.begin();
         it != this->TestList.end(); it ++ )
      { 
      cmCTestTestProperties& p = *it;
!     cmCTestMultiProcessHandler::TestSet depends;
! 
      if(p.Depends.size())
        {
***************
*** 1036,1041 ****
      tests[it->Index] = depends;
      properties[it->Index] = &*it;
      }
!   parallel.SetTests(tests, properties);
    parallel.SetPassFailVectors(&passed, &failed);
    this->TestResults.clear();
--- 1038,1047 ----
      tests[it->Index] = depends;
      properties[it->Index] = &*it;
+     if(it->Expensive)
+       {
+       expensiveTests[it->Index] = depends;
+       }
      }
!   parallel.SetTests(tests, expensiveTests, properties);
    parallel.SetPassFailVectors(&passed, &failed);
    this->TestResults.clear();

Index: cmProcess.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CTest/cmProcess.cxx,v
retrieving revision 1.8
retrieving revision 1.9
diff -C 2 -d -r1.8 -r1.9
*** cmProcess.cxx	3 Sep 2009 19:50:47 -0000	1.8
--- cmProcess.cxx	4 Sep 2009 14:16:06 -0000	1.9
***************
*** 23,26 ****
--- 23,31 ----
    this->Process = 0;
    this->Timeout = 0;
+   this->TotalTime = 0;
+   this->LastOutputPipe = cmsysProcess_Pipe_None;
+   this->ExitValue = 0;
+   this->Id = 0;
+   this->StartTime = 0;
  }
  



More information about the Cmake-commits mailing list