diff --git a/Source/CTest/cmCTestTestCommand.cxx b/Source/CTest/cmCTestTestCommand.cxx index 3efb39baa..487f3bd9d 100644 --- a/Source/CTest/cmCTestTestCommand.cxx +++ b/Source/CTest/cmCTestTestCommand.cxx @@ -28,6 +28,7 @@ cmCTestTestCommand::cmCTestTestCommand() this->Arguments[ctt_INCLUDE] = "INCLUDE"; this->Arguments[ctt_EXCLUDE_LABEL] = "EXCLUDE_LABEL"; this->Arguments[ctt_INCLUDE_LABEL] = "INCLUDE_LABEL"; + this->Arguments[ctt_PARALLEL_LEVEL] = "PARALLEL_LEVEL"; this->Arguments[ctt_LAST] = 0; this->Last = ctt_LAST; } @@ -90,6 +91,11 @@ cmCTestGenericHandler* cmCTestTestCommand::InitializeHandler() handler->SetOption("LabelRegularExpression", this->Values[ctt_INCLUDE_LABEL]); } + if(this->Values[ctt_PARALLEL_LEVEL]) + { + handler->SetOption("ParallelLevel", + this->Values[ctt_PARALLEL_LEVEL]); + } return handler; } diff --git a/Source/CTest/cmCTestTestCommand.h b/Source/CTest/cmCTestTestCommand.h index 314763794..f294e026c 100644 --- a/Source/CTest/cmCTestTestCommand.h +++ b/Source/CTest/cmCTestTestCommand.h @@ -65,7 +65,8 @@ public: " [STRIDE stride number] [EXCLUDE exclude regex ]\n" " [INCLUDE include regex] [RETURN_VALUE res] \n" " [EXCLUDE_LABEL exclude regex] \n" - " [INCLUDE_LABEL label regex] )\n" + " [INCLUDE_LABEL label regex] \n" + " [PARALLEL_LEVEL level] )\n" "Tests the given build directory and stores results in Test.xml. The " "second argument is a variable that will hold value. Optionally, " "you can specify the starting test number START, the ending test number " @@ -73,7 +74,8 @@ public: "expression for tests to run INCLUDE, or a regular expression for tests " "to not run EXCLUDE. EXCLUDE_LABEL and INCLUDE_LABEL are regular " "expression for test to be included or excluded by the test " - "property LABEL." + "property LABEL. PARALLEL_LEVEL should be set to a positive number " + "representing the number of tests to be run in parallel." "\n" CTEST_COMMAND_APPEND_OPTION_DOCS; } @@ -94,6 +96,7 @@ protected: ctt_INCLUDE, ctt_EXCLUDE_LABEL, ctt_INCLUDE_LABEL, + ctt_PARALLEL_LEVEL, ctt_LAST }; }; diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 1af1cf981..c35c8d4fb 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -495,7 +495,11 @@ int cmCTestTestHandler::ProcessHandler() { // Update internal data structure from generic one this->SetTestsToRunInformation(this->GetOption("TestsToRunInformation")); - this->SetUseUnion(cmSystemTools::IsOn(this->GetOption("UseUnion"))); + this->SetUseUnion(cmSystemTools::IsOn(this->GetOption("UseUnion"))); + if(this->GetOption("ParallelLevel")) + { + this->CTest->SetParallelLevel(atoi(this->GetOption("ParallelLevel"))); + } const char* val; val = this->GetOption("LabelRegularExpression"); if ( val )