ENH: Added PARALLEL_LEVEL option to ctest_test() command.

This commit is contained in:
Zach Mullen 2009-09-02 12:35:42 -04:00
parent 69fd641adb
commit 7e20db0224
3 changed files with 16 additions and 3 deletions

View File

@ -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;
}

View File

@ -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
};
};

View File

@ -496,6 +496,10 @@ int cmCTestTestHandler::ProcessHandler()
// Update internal data structure from generic one
this->SetTestsToRunInformation(this->GetOption("TestsToRunInformation"));
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 )