소스 검색

cmCTestMultiProcessHandler: Clarify role of StartTestProcess

Focus its role on actually running the test process.
Move administrative tasks to the call site.
Brad King 2 년 전
부모
커밋
b17c732e88
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 4
      Source/CTest/cmCTestMultiProcessHandler.cxx

+ 4 - 4
Source/CTest/cmCTestMultiProcessHandler.cxx

@@ -164,12 +164,8 @@ void cmCTestMultiProcessHandler::RunTests()
 
 
 void cmCTestMultiProcessHandler::StartTestProcess(int test)
 void cmCTestMultiProcessHandler::StartTestProcess(int test)
 {
 {
-  this->LockResources(test);
-
   cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
   cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
                      "test " << test << "\n", this->Quiet);
                      "test " << test << "\n", this->Quiet);
-  // now remove the test itself
-  this->ErasePendingTest(test);
 
 
   auto testRun = cm::make_unique<cmCTestRunTest>(*this, test);
   auto testRun = cm::make_unique<cmCTestRunTest>(*this, test);
 
 
@@ -591,8 +587,12 @@ void cmCTestMultiProcessHandler::StartNextTests()
       continue;
       continue;
     }
     }
 
 
+    // Lock resources needed by this test.
+    this->LockResources(test);
+
     // The test is ready to run.
     // The test is ready to run.
     numToStart -= processors;
     numToStart -= processors;
+    this->ErasePendingTest(test);
     this->StartTest(test);
     this->StartTest(test);
   }
   }