diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2020-02-24 15:53:32 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2020-02-24 20:44:01 (GMT) |
commit | f0df3ed5b99257ab8109fcbe09e8ff97565c00c8 (patch) | |
tree | 08e8d41d91e733e624c80127672c65501ee5ce00 /Source/CTest/cmCTestMultiProcessHandler.h | |
parent | f1c34443b7fa828150e4e13b0dea3c5fbd29b6eb (diff) | |
download | CMake-f0df3ed5b99257ab8109fcbe09e8ff97565c00c8.zip CMake-f0df3ed5b99257ab8109fcbe09e8ff97565c00c8.tar.gz CMake-f0df3ed5b99257ab8109fcbe09e8ff97565c00c8.tar.bz2 |
Refactor: Provide more detailed error information from TryAllocateResources()
Diffstat (limited to 'Source/CTest/cmCTestMultiProcessHandler.h')
-rw-r--r-- | Source/CTest/cmCTestMultiProcessHandler.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Source/CTest/cmCTestMultiProcessHandler.h b/Source/CTest/cmCTestMultiProcessHandler.h index 4837401..5b429d4 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.h +++ b/Source/CTest/cmCTestMultiProcessHandler.h @@ -143,11 +143,18 @@ protected: void LockResources(int index); void UnlockResources(int index); + enum class ResourceAllocationError + { + NoResourceType, + InsufficientResources, + }; + bool AllocateResources(int index); bool TryAllocateResources( int index, std::map<std::string, std::vector<cmCTestBinPackerAllocation>>& - allocations); + allocations, + std::map<std::string, ResourceAllocationError>* errors = nullptr); void DeallocateResources(int index); bool AllResourcesAvailable(); @@ -174,7 +181,8 @@ protected: std::map<int, std::vector<std::map<std::string, std::vector<ResourceAllocation>>>> AllocatedResources; - std::map<int, bool> TestsHaveSufficientResources; + std::map<int, std::map<std::string, ResourceAllocationError>> + ResourceAllocationErrors; cmCTestResourceAllocator ResourceAllocator; std::vector<cmCTestTestHandler::cmCTestTestResult>* TestResults; size_t ParallelLevel; // max number of process that can be run at once |