summaryrefslogtreecommitdiffstats
path: root/Source/CTest
diff options
context:
space:
mode:
authorCasey Goodlett <casey.goodlett@kitware.com>2012-12-18 18:09:53 (GMT)
committerDavid Cole <david.cole@kitware.com>2012-12-18 18:30:34 (GMT)
commit324780697c5020a027efdc24bd9cc2fc926a3546 (patch)
treecad8a69bc9b3881c226a9fd2d6eef20686a1b3e2 /Source/CTest
parent8931dd6e74bce78737baaf78c9867c992829c60b (diff)
downloadCMake-324780697c5020a027efdc24bd9cc2fc926a3546.zip
CMake-324780697c5020a027efdc24bd9cc2fc926a3546.tar.gz
CMake-324780697c5020a027efdc24bd9cc2fc926a3546.tar.bz2
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.
Diffstat (limited to 'Source/CTest')
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx
index ebef1ed..76ddeea 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.cxx
+++ b/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;