瀏覽代碼

cmCTestMultiProcessHandler: Simplify loop termination on serial test

Brad King 2 年之前
父節點
當前提交
b02b628ad9
共有 1 個文件被更改,包括 2 次插入5 次删除
  1. 2 5
      Source/CTest/cmCTestMultiProcessHandler.cxx

+ 2 - 5
Source/CTest/cmCTestMultiProcessHandler.cxx

@@ -542,15 +542,12 @@ void cmCTestMultiProcessHandler::StartNextTests()
 
 
   // Start tests in the preferred order, each subject to readiness checks.
   // Start tests in the preferred order, each subject to readiness checks.
   auto ti = this->OrderedTests.begin();
   auto ti = this->OrderedTests.begin();
-  while (numToStart > 0 && ti != this->OrderedTests.end()) {
+  while (numToStart > 0 && !this->SerialTestRunning &&
+         ti != this->OrderedTests.end()) {
     // Increment the test iterator now because the current list
     // Increment the test iterator now because the current list
     // entry may be deleted below.
     // entry may be deleted below.
     int test = *ti++;
     int test = *ti++;
 
 
-    // Take a nap if we're currently performing a RUN_SERIAL test.
-    if (this->SerialTestRunning) {
-      break;
-    }
     // We can only start a RUN_SERIAL test if no other tests are also
     // We can only start a RUN_SERIAL test if no other tests are also
     // running.
     // running.
     if (this->Properties[test]->RunSerial && this->RunningCount > 0) {
     if (this->Properties[test]->RunSerial && this->RunningCount > 0) {