diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2019-06-27 20:38:19 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-10-02 13:33:54 (GMT) |
commit | bb4a1410592342a824b1dd755b7ca8897deac65c (patch) | |
tree | 9131b8f3b5e531a9fb5471a0b77e9d0b121f5f00 /Source/CTest/cmCTestTestHandler.cxx | |
parent | a1f78a481c8cbda1f0c8503c4d661c3c3ddf00a6 (diff) | |
download | CMake-bb4a1410592342a824b1dd755b7ca8897deac65c.zip CMake-bb4a1410592342a824b1dd755b7ca8897deac65c.tar.gz CMake-bb4a1410592342a824b1dd755b7ca8897deac65c.tar.bz2 |
CTest: Add lexer for PROCESSES property
Diffstat (limited to 'Source/CTest/cmCTestTestHandler.cxx')
-rw-r--r-- | Source/CTest/cmCTestTestHandler.cxx | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 67d16af..927e086 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -29,6 +29,7 @@ #include "cmAlgorithms.h" #include "cmCTest.h" #include "cmCTestMultiProcessHandler.h" +#include "cmCTestProcessesLexerHelper.h" #include "cmDuration.h" #include "cmExecutionStatus.h" #include "cmGeneratedFileStream.h" @@ -1610,6 +1611,14 @@ std::string cmCTestTestHandler::FindExecutable( return fullPath; } +bool cmCTestTestHandler::ParseProcessesProperty( + const std::string& val, + std::vector<std::vector<cmCTestTestResourceRequirement>>& processes) +{ + cmCTestProcessesLexerHelper lexer(processes); + return lexer.ParseString(val); +} + void cmCTestTestHandler::GetListOfTests() { if (!this->IncludeLabelRegExp.empty()) { @@ -2179,6 +2188,11 @@ bool cmCTestTestHandler::SetTestsProperties( if (key == "PROCESSOR_AFFINITY") { rt.WantAffinity = cmIsOn(val); } + if (key == "PROCESSES") { + if (!ParseProcessesProperty(val, rt.Processes)) { + return false; + } + } if (key == "SKIP_RETURN_CODE") { rt.SkipReturnCode = atoi(val.c_str()); if (rt.SkipReturnCode < 0 || rt.SkipReturnCode > 255) { @@ -2356,3 +2370,17 @@ bool cmCTestTestHandler::AddTest(const std::vector<std::string>& args) this->TestList.push_back(test); return true; } + +bool cmCTestTestHandler::cmCTestTestResourceRequirement::operator==( + const cmCTestTestResourceRequirement& other) const +{ + return this->ResourceType == other.ResourceType && + this->SlotsNeeded == other.SlotsNeeded && + this->UnitsNeeded == other.UnitsNeeded; +} + +bool cmCTestTestHandler::cmCTestTestResourceRequirement::operator!=( + const cmCTestTestResourceRequirement& other) const +{ + return !(*this == other); +} |