diff options
author | Brad King <brad.king@kitware.com> | 2023-10-20 22:16:01 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-11-21 17:36:31 (GMT) |
commit | 5ff0b4ed57e4ccea77e78e128765e3ecc7e86f50 (patch) | |
tree | d2955c4906f425ee880a7d83f2c684d186b26bba /Source | |
parent | ad3df3ce4dfe772c0a95eefd88628b4a800803d9 (diff) | |
download | CMake-5ff0b4ed57e4ccea77e78e128765e3ecc7e86f50.zip CMake-5ff0b4ed57e4ccea77e78e128765e3ecc7e86f50.tar.gz CMake-5ff0b4ed57e4ccea77e78e128765e3ecc7e86f50.tar.bz2 |
cmCTestMultiProcessHandler: Consolidate test readiness checks
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CTest/cmCTestMultiProcessHandler.cxx | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index 3759af1..d97148d 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.cxx +++ b/Source/CTest/cmCTestMultiProcessHandler.cxx @@ -449,17 +449,6 @@ std::string cmCTestMultiProcessHandler::GetName(int test) bool cmCTestMultiProcessHandler::StartTest(int test) { - // Check for locked project resources. - for (std::string const& i : this->Properties[test]->ProjectResources) { - if (cm::contains(this->ProjectResourcesLocked, i)) { - return false; - } - } - - if (!this->AllocateResources(test)) { - return false; - } - return this->StartTestProcess(test); } @@ -576,6 +565,19 @@ void cmCTestMultiProcessHandler::StartNextTests() continue; } + // Exclude tests that depend on currently-locked project resources. + for (std::string const& i : this->Properties[test]->ProjectResources) { + if (cm::contains(this->ProjectResourcesLocked, i)) { + continue; + } + } + + // Allocate system resources needed by this test. + if (!this->AllocateResources(test)) { + continue; + } + + // The test is ready to run. if (this->StartTest(test)) { numToStart -= processors; } |