Преглед изворни кода

CTest: Prevent creation of unbounded number of tests in ctest (#12904)

Note it is still possible for CTest to start more than the number of
processes specified by PARALLEL_LEVEL, but this prevents the number of
tests to start from being unbounded because of overflow.
Casey Goodlett пре 13 година
родитељ
комит
324780697c
1 измењених фајлова са 6 додато и 1 уклоњено
  1. 6 1
      Source/CTest/cmCTestMultiProcessHandler.cxx

+ 6 - 1
Source/CTest/cmCTestMultiProcessHandler.cxx

@@ -248,7 +248,12 @@ bool cmCTestMultiProcessHandler::StartTest(int test)
 //---------------------------------------------------------
 void cmCTestMultiProcessHandler::StartNextTests()
 {
-  size_t numToStart = this->ParallelLevel - this->RunningCount;
+  size_t numToStart = 0;
+  if(this->RunningCount < this->ParallelLevel)
+    {
+    numToStart = this->ParallelLevel - this->RunningCount;
+    }
+
   if(numToStart == 0)
     {
     return;