summaryrefslogtreecommitdiffstats
path: root/Source/CTest
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-11-15 21:01:09 (GMT)
committerBrad King <brad.king@kitware.com>2023-11-17 23:43:01 (GMT)
commita4b061a035c782974642bf2ca2d8d5e1a2f94553 (patch)
tree12ed1c4e023bcb7914647491c59291b4a1ddfcae /Source/CTest
parent1487e540aa2bc069a7d156a3ad884e98edfb8815 (diff)
downloadCMake-a4b061a035c782974642bf2ca2d8d5e1a2f94553.zip
CMake-a4b061a035c782974642bf2ca2d8d5e1a2f94553.tar.gz
CMake-a4b061a035c782974642bf2ca2d8d5e1a2f94553.tar.bz2
cmCTestMultiProcessHandler: Clarify resource availability error member names
The members are about the availability of sufficient resources, not allocation of them.
Diffstat (limited to 'Source/CTest')
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.cxx20
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.h10
-rw-r--r--Source/CTest/cmCTestRunTest.cxx2
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx2
4 files changed, 17 insertions, 17 deletions
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx
index bee8735..67bbb4a 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.cxx
+++ b/Source/CTest/cmCTestMultiProcessHandler.cxx
@@ -196,18 +196,18 @@ bool cmCTestMultiProcessHandler::StartTestProcess(int test)
// working directory because FinishTestProcess() will try to unlock them
this->LockResources(test);
- if (!this->ResourceAllocationErrors[test].empty()) {
+ if (!this->ResourceAvailabilityErrors[test].empty()) {
std::ostringstream e;
e << "Insufficient resources for test " << this->Properties[test]->Name
<< ":\n\n";
- for (auto const& it : this->ResourceAllocationErrors[test]) {
+ for (auto const& it : this->ResourceAvailabilityErrors[test]) {
switch (it.second) {
- case ResourceAllocationError::NoResourceType:
+ case ResourceAvailabilityError::NoResourceType:
e << " Test requested resources of type '" << it.first
<< "' which does not exist\n";
break;
- case ResourceAllocationError::InsufficientResources:
+ case ResourceAvailabilityError::InsufficientResources:
e << " Test requested resources of type '" << it.first
<< "' in the following amounts:\n";
for (auto const& group : this->Properties[test]->ResourceGroups) {
@@ -280,7 +280,7 @@ bool cmCTestMultiProcessHandler::AllocateResources(int index)
bool cmCTestMultiProcessHandler::TryAllocateResources(
int index,
std::map<std::string, std::vector<cmCTestBinPackerAllocation>>& allocations,
- std::map<std::string, ResourceAllocationError>* errors)
+ std::map<std::string, ResourceAvailabilityError>* errors)
{
allocations.clear();
@@ -300,7 +300,7 @@ bool cmCTestMultiProcessHandler::TryAllocateResources(
for (auto& it : allocations) {
if (!availableResources.count(it.first)) {
if (errors) {
- (*errors)[it.first] = ResourceAllocationError::NoResourceType;
+ (*errors)[it.first] = ResourceAvailabilityError::NoResourceType;
result = false;
} else {
return false;
@@ -308,7 +308,7 @@ bool cmCTestMultiProcessHandler::TryAllocateResources(
} else if (!cmAllocateCTestResourcesRoundRobin(
availableResources.at(it.first), it.second)) {
if (errors) {
- (*errors)[it.first] = ResourceAllocationError::InsufficientResources;
+ (*errors)[it.first] = ResourceAvailabilityError::InsufficientResources;
result = false;
} else {
return false;
@@ -355,14 +355,14 @@ bool cmCTestMultiProcessHandler::AllResourcesAvailable()
return true;
}
-void cmCTestMultiProcessHandler::CheckResourcesAvailable()
+void cmCTestMultiProcessHandler::CheckResourceAvailability()
{
if (this->UseResourceSpec) {
for (auto const& t : this->PendingTests) {
std::map<std::string, std::vector<cmCTestBinPackerAllocation>>
allocations;
this->TryAllocateResources(t.first, allocations,
- &this->ResourceAllocationErrors[t.first]);
+ &this->ResourceAvailabilityErrors[t.first]);
}
}
}
@@ -455,7 +455,7 @@ bool cmCTestMultiProcessHandler::StartTest(int test)
}
// Allocate resources
- if (this->ResourceAllocationErrors[test].empty() &&
+ if (this->ResourceAvailabilityErrors[test].empty() &&
!this->AllocateResources(test)) {
this->DeallocateResources(test);
return false;
diff --git a/Source/CTest/cmCTestMultiProcessHandler.h b/Source/CTest/cmCTestMultiProcessHandler.h
index f161793..c01089c 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.h
+++ b/Source/CTest/cmCTestMultiProcessHandler.h
@@ -104,7 +104,7 @@ public:
void SetQuiet(bool b) { this->Quiet = b; }
- void CheckResourcesAvailable();
+ void CheckResourceAvailability();
protected:
// Start the next test or tests as many as are allowed by
@@ -151,7 +151,7 @@ protected:
void LockResources(int index);
void UnlockResources(int index);
- enum class ResourceAllocationError
+ enum class ResourceAvailabilityError
{
NoResourceType,
InsufficientResources,
@@ -163,7 +163,7 @@ protected:
int index,
std::map<std::string, std::vector<cmCTestBinPackerAllocation>>&
allocations,
- std::map<std::string, ResourceAllocationError>* errors = nullptr);
+ std::map<std::string, ResourceAvailabilityError>* errors = nullptr);
void DeallocateResources(int index);
bool AllResourcesAvailable();
bool InitResourceAllocator(std::string& error);
@@ -198,8 +198,8 @@ protected:
std::map<int,
std::vector<std::map<std::string, std::vector<ResourceAllocation>>>>
AllocatedResources;
- std::map<int, std::map<std::string, ResourceAllocationError>>
- ResourceAllocationErrors;
+ std::map<int, std::map<std::string, ResourceAvailabilityError>>
+ ResourceAvailabilityErrors;
cmCTestResourceAllocator ResourceAllocator;
std::vector<cmCTestTestHandler::cmCTestTestResult>* TestResults;
size_t ParallelLevel; // max number of process that can be run at once
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx
index 4b97365..e96dc1f 100644
--- a/Source/CTest/cmCTestRunTest.cxx
+++ b/Source/CTest/cmCTestRunTest.cxx
@@ -165,7 +165,7 @@ cmCTestRunTest::EndTestResult cmCTestRunTest::EndTest(size_t completed,
reason = "Invalid resource spec file";
forceFail = true;
} else {
- this->MultiTestHandler.CheckResourcesAvailable();
+ this->MultiTestHandler.CheckResourceAvailability();
}
}
std::ostringstream outputStream;
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index f8a8f9f..ba15366 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -1389,7 +1389,7 @@ bool cmCTestTestHandler::ProcessDirectory(std::vector<std::string>& passed,
parallel->SetPassFailVectors(&passed, &failed);
this->TestResults.clear();
parallel->SetTestResults(&this->TestResults);
- parallel->CheckResourcesAvailable();
+ parallel->CheckResourceAvailability();
if (this->CTest->ShouldPrintLabels()) {
parallel->PrintLabels();