summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-01-03 18:53:18 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2013-01-03 18:53:18 (GMT)
commite2969c503b125a40376ec4ac0399e462e3011077 (patch)
tree2889777c91c8eae6b36287481730f8e344766b1c /Source
parentde53c4c695604bbe00a2dca86d2ac6f2971e2bdd (diff)
parente378ba5f39a9d8ebe0335390870a82774ecdd171 (diff)
downloadCMake-e2969c503b125a40376ec4ac0399e462e3011077.zip
CMake-e2969c503b125a40376ec4ac0399e462e3011077.tar.gz
CMake-e2969c503b125a40376ec4ac0399e462e3011077.tar.bz2
Merge topic 'fix-12904-avoid-overflow'
e378ba5 Add CTestLimitDashJ test (#12904) 3247806 CTest: Prevent creation of unbounded number of tests in ctest (#12904)
Diffstat (limited to 'Source')
-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;