diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2019-07-09 20:06:17 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-10-02 13:33:54 (GMT) |
commit | e34de0691b3bd94720c44c1efad47c3d39ff4134 (patch) | |
tree | 934491b44ad3d1241b73226f7539fff6d042c2b5 /Source/CTest/cmCTestTestHandler.cxx | |
parent | aee09648511433160f7fd660eb3c746719810216 (diff) | |
download | CMake-e34de0691b3bd94720c44c1efad47c3d39ff4134.zip CMake-e34de0691b3bd94720c44c1efad47c3d39ff4134.tar.gz CMake-e34de0691b3bd94720c44c1efad47c3d39ff4134.tar.bz2 |
CTest: Allocate hardware to tests
Diffstat (limited to 'Source/CTest/cmCTestTestHandler.cxx')
-rw-r--r-- | Source/CTest/cmCTestTestHandler.cxx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 927e086..2be62ae 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -289,6 +289,7 @@ cmCTestTestHandler::cmCTestTestHandler() this->UseIncludeRegExpFlag = false; this->UseExcludeRegExpFlag = false; this->UseExcludeRegExpFirst = false; + this->UseHardwareSpec = false; this->CustomMaximumPassedTestOutputSize = 1 * 1024; this->CustomMaximumFailedTestOutputSize = 300 * 1024; @@ -509,6 +510,16 @@ bool cmCTestTestHandler::ProcessOptions() } this->SetRerunFailed(cmIsOn(this->GetOption("RerunFailed"))); + val = this->GetOption("HardwareSpecFile"); + if (val) { + this->UseHardwareSpec = true; + if (!this->HardwareSpec.ReadFromJSONFile(val)) { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Could not read hardware spec file: " << val << std::endl); + return false; + } + } + return true; } @@ -1226,6 +1237,9 @@ void cmCTestTestHandler::ProcessDirectory(std::vector<std::string>& passed, } else { parallel->SetTestLoad(this->CTest->GetTestLoad()); } + if (this->UseHardwareSpec) { + parallel->InitHardwareAllocator(this->HardwareSpec); + } *this->LogFile << "Start testing: " << this->CTest->CurrentTime() << std::endl @@ -1269,6 +1283,7 @@ void cmCTestTestHandler::ProcessDirectory(std::vector<std::string>& passed, parallel->SetPassFailVectors(&passed, &failed); this->TestResults.clear(); parallel->SetTestResults(&this->TestResults); + parallel->CheckHardwareAvailable(); if (this->CTest->ShouldPrintLabels()) { parallel->PrintLabels(); |