浏览代码

cmCTestRunTest: Thread number of completed tests through start APIs

Michael Wegner 7 年之前
父节点
当前提交
62fbe5002a
共有 3 个文件被更改,包括 8 次插入7 次删除
  1. 2 2
      Source/CTest/cmCTestMultiProcessHandler.cxx
  2. 4 3
      Source/CTest/cmCTestRunTest.cxx
  3. 2 2
      Source/CTest/cmCTestRunTest.h

+ 2 - 2
Source/CTest/cmCTestMultiProcessHandler.cxx

@@ -178,7 +178,7 @@ bool cmCTestMultiProcessHandler::StartTestProcess(int test)
                           this->Properties[test]->Directory + " : " +
                           std::strerror(workdir.GetLastResult()));
   } else {
-    if (testRun->StartTest(this->Total)) {
+    if (testRun->StartTest(this->Completed, this->Total)) {
       return true;
     }
   }
@@ -440,7 +440,7 @@ void cmCTestMultiProcessHandler::FinishTestProcess(cmCTestRunTest* runner,
     this->SetStopTimePassed();
   }
   if (started) {
-    if (!this->StopTimePassed && runner->StartAgain()) {
+    if (!this->StopTimePassed && runner->StartAgain(this->Completed)) {
       this->Completed--; // remove the completed test because run again
       return;
     }

+ 4 - 3
Source/CTest/cmCTestRunTest.cxx

@@ -334,7 +334,7 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started)
   return passed || skipped;
 }
 
-bool cmCTestRunTest::StartAgain()
+bool cmCTestRunTest::StartAgain(size_t completed)
 {
   if (!this->RunAgain) {
     return false;
@@ -349,7 +349,7 @@ bool cmCTestRunTest::StartAgain()
     return true;
   }
 
-  this->StartTest(this->TotalNumberOfTests);
+  this->StartTest(completed, this->TotalNumberOfTests);
   return true;
 }
 
@@ -429,9 +429,10 @@ void cmCTestRunTest::StartFailure(std::string const& output)
 }
 
 // Starts the execution of a test.  Returns once it has started
-bool cmCTestRunTest::StartTest(size_t total)
+bool cmCTestRunTest::StartTest(size_t completed, size_t total)
 {
   this->TotalNumberOfTests = total; // save for rerun case
+  static_cast<void>(completed);
   cmCTestLog(this->CTest, HANDLER_OUTPUT,
              std::setw(2 * getNumWidth(total) + 8)
                << "Start "

+ 2 - 2
Source/CTest/cmCTestRunTest.h

@@ -65,7 +65,7 @@ public:
   void CompressOutput();
 
   // launch the test process, return whether it started correctly
-  bool StartTest(size_t total);
+  bool StartTest(size_t completed, size_t total);
   // capture and report the test results
   bool EndTest(size_t completed, size_t total, bool started);
   // Called by ctest -N to log the command string
@@ -73,7 +73,7 @@ public:
 
   void ComputeWeightedCost();
 
-  bool StartAgain();
+  bool StartAgain(size_t completed);
 
   void StartFailure(std::string const& output);