diff options
-rw-r--r-- | Source/CTest/cmCTestMemCheckCommand.h | 6 | ||||
-rw-r--r-- | Source/CTest/cmCTestMultiProcessHandler.cxx | 9 | ||||
-rw-r--r-- | Source/CTest/cmCTestRunTest.cxx | 2 | ||||
-rw-r--r-- | Source/CTest/cmCTestTestHandler.cxx | 9 | ||||
-rw-r--r-- | Source/CTest/cmCTestTestHandler.h | 2 | ||||
-rw-r--r-- | Source/cmSetTestsPropertiesCommand.h | 3 | ||||
-rw-r--r-- | Tests/CTestTest3/test.cmake.in | 4 |
7 files changed, 27 insertions, 8 deletions
diff --git a/Source/CTest/cmCTestMemCheckCommand.h b/Source/CTest/cmCTestMemCheckCommand.h index eeb1327..3e5cdd6 100644 --- a/Source/CTest/cmCTestMemCheckCommand.h +++ b/Source/CTest/cmCTestMemCheckCommand.h @@ -67,7 +67,8 @@ public: " [STRIDE stride number] [EXCLUDE exclude regex ]\n" " [INCLUDE include regex] \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 MemCheck.xml. " "The second argument is a variable that will hold value. Optionally, " "you can specify the starting test number START, the ending test number " @@ -75,7 +76,8 @@ public: "expression for tests to run INCLUDE, or a regular expression for tests " "not to run EXCLUDE. EXCLUDE_LABEL and INCLUDE_LABEL are regular " "expressions for tests 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; } diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index be5bbfd..0f7cd3c 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.cxx +++ b/Source/CTest/cmCTestMultiProcessHandler.cxx @@ -74,10 +74,10 @@ void cmCTestMultiProcessHandler::RunTests() void cmCTestMultiProcessHandler::SubmitBatchTests() { for(cmCTest::CTestConfigurationMap::iterator i = - this->CTest->CTestConfiguration.begin(); - i != this->CTest->CTestConfiguration.end(); ++i) + this->CTest->CTestConfiguration.begin(); + i != this->CTest->CTestConfiguration.end(); ++i) { - cmCTestLog(this->CTest, HANDLER_OUTPUT, i->first + cmCTestLog(this->CTest, HANDLER_OUTPUT, i->first << " = " << i->second << std::endl); } } @@ -161,6 +161,9 @@ void cmCTestMultiProcessHandler::StartNextTests() for(TestMap::iterator i = tests.begin(); i != tests.end(); ++i) { + int processors = this->Properties[i->first]->Processors; + +// if(processors > ) // start test should start only one test if(this->StartTest(i->first)) { diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index 49bce1e..81dff52 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -437,7 +437,7 @@ void cmCTestRunTest::WriteLogOutputTop(size_t completed, size_t total) if ( this->TestHandler->MemCheck ) { - cmCTestLog(this->CTest, HANDLER_OUTPUT, "Memory Check"); + cmCTestLog(this->CTest, HANDLER_OUTPUT, "MemCheck"); } else { diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index c35c8d4..94008d1 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -1982,6 +1982,14 @@ bool cmCTestTestHandler::SetTestsProperties( std::string(crit->c_str()))); } } + if ( key == "PROCESSORS" ) + { + rtit->Processors = atoi(val.c_str()); + if(rtit->Processors < 1) + { + rtit->Processors = 1; + } + } if ( key == "DEPENDS" ) { std::vector<std::string> lval; @@ -2109,6 +2117,7 @@ bool cmCTestTestHandler::AddTest(const std::vector<std::string>& args) test.IsInBasedOnREOptions = true; test.WillFail = false; test.Timeout = 0; + test.Processors = 1; if (this->UseIncludeRegExpFlag && !this->IncludeTestsRegularExpression.find(testname.c_str())) { diff --git a/Source/CTest/cmCTestTestHandler.h b/Source/CTest/cmCTestTestHandler.h index 12e86a9..899a638 100644 --- a/Source/CTest/cmCTestTestHandler.h +++ b/Source/CTest/cmCTestTestHandler.h @@ -98,6 +98,8 @@ public: bool WillFail; double Timeout; int Index; + //Requested number of process slots + int Processors; std::vector<std::string> Environment; std::vector<std::string> Labels; }; diff --git a/Source/cmSetTestsPropertiesCommand.h b/Source/cmSetTestsPropertiesCommand.h index e25b0a5..1644abe 100644 --- a/Source/cmSetTestsPropertiesCommand.h +++ b/Source/cmSetTestsPropertiesCommand.h @@ -69,6 +69,9 @@ public: " Example: PASS_REGULAR_EXPRESSION \"[^a-z]Error;ERROR;Failed\"\n" "Both PASS_REGULAR_EXPRESSION and FAIL_REGULAR_EXPRESSION expect a " "list of regular expressions.\n"; + "PROCESSORS: Denotes the number of processors that this test will " + "require. This is typically used for MPI tests, and should be used in " + "conjunction with the ctest_test PARALLEL_LEVEL option.\n"; } cmTypeMacro(cmSetTestsPropertiesCommand, cmCommand); diff --git a/Tests/CTestTest3/test.cmake.in b/Tests/CTestTest3/test.cmake.in index ade256a..734bdf4 100644 --- a/Tests/CTestTest3/test.cmake.in +++ b/Tests/CTestTest3/test.cmake.in @@ -97,8 +97,8 @@ IF(svncommand) CTEST_UPDATE(SOURCE "${CTEST_SOURCE_DIRECTORY}" RETURN_VALUE res) CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) - CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) - CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) + CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res PARALLEL_LEVEL 5) + CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res PARALLEL_LEVEL 5) CTEST_COVERAGE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) CTEST_SUBMIT(RETURN_VALUE res) |