From 324780697c5020a027efdc24bd9cc2fc926a3546 Mon Sep 17 00:00:00 2001 From: Casey Goodlett Date: Tue, 18 Dec 2012 13:09:53 -0500 Subject: 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. --- Source/CTest/cmCTestMultiProcessHandler.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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; -- cgit v0.12