cmCTestTestHandler: Clarify name of member storing RESOURCE_LOCK property

The property represents project-defined resources.
This commit is contained in:
Brad King
2023-11-15 15:07:02 -05:00
parent 773fd7e05d
commit 3c4767f467
4 changed files with 12 additions and 12 deletions
+9 -9
View File
@@ -401,8 +401,8 @@ void cmCTestMultiProcessHandler::SetStopTimePassed()
void cmCTestMultiProcessHandler::LockResources(int index)
{
auto* properties = this->Properties[index];
this->LockedResources.insert(properties->LockedResources.begin(),
properties->LockedResources.end());
this->ProjectResourcesLocked.insert(properties->ProjectResources.begin(),
properties->ProjectResources.end());
if (properties->RunSerial) {
this->SerialTestRunning = true;
}
@@ -411,8 +411,8 @@ void cmCTestMultiProcessHandler::LockResources(int index)
void cmCTestMultiProcessHandler::UnlockResources(int index)
{
auto* properties = this->Properties[index];
for (std::string const& i : properties->LockedResources) {
this->LockedResources.erase(i);
for (std::string const& i : properties->ProjectResources) {
this->ProjectResourcesLocked.erase(i);
}
if (properties->RunSerial) {
this->SerialTestRunning = false;
@@ -449,9 +449,9 @@ std::string cmCTestMultiProcessHandler::GetName(int test)
bool cmCTestMultiProcessHandler::StartTest(int test)
{
// Check for locked resources
for (std::string const& i : this->Properties[test]->LockedResources) {
if (cm::contains(this->LockedResources, i)) {
// Check for locked project resources.
for (std::string const& i : this->Properties[test]->ProjectResources) {
if (cm::contains(this->ProjectResourcesLocked, i)) {
return false;
}
}
@@ -1093,9 +1093,9 @@ static Json::Value DumpCTestProperties(
properties.append(DumpCTestProperty(
"REQUIRED_FILES", DumpToJsonArray(testProperties.RequiredFiles)));
}
if (!testProperties.LockedResources.empty()) {
if (!testProperties.ProjectResources.empty()) {
properties.append(DumpCTestProperty(
"RESOURCE_LOCK", DumpToJsonArray(testProperties.LockedResources)));
"RESOURCE_LOCK", DumpToJsonArray(testProperties.ProjectResources)));
}
if (testProperties.RunSerial) {
properties.append(
+1 -1
View File
@@ -194,7 +194,7 @@ protected:
std::vector<std::string>* Passed;
std::vector<std::string>* Failed;
std::vector<std::string> LastTestsFailed;
std::set<std::string> LockedResources;
std::set<std::string> ProjectResourcesLocked;
std::map<int,
std::vector<std::map<std::string, std::vector<ResourceAllocation>>>>
AllocatedResources;
+1 -1
View File
@@ -2233,7 +2233,7 @@ bool cmCTestTestHandler::SetTestsProperties(
} else if (key == "RESOURCE_LOCK"_s) {
cmList lval{ val };
rt.LockedResources.insert(lval.begin(), lval.end());
rt.ProjectResources.insert(lval.begin(), lval.end());
} else if (key == "FIXTURES_SETUP"_s) {
cmList lval{ val };
+1 -1
View File
@@ -165,7 +165,7 @@ public:
std::vector<std::string> Environment;
std::vector<std::string> EnvironmentModification;
std::vector<std::string> Labels;
std::set<std::string> LockedResources;
std::set<std::string> ProjectResources; // RESOURCE_LOCK
std::set<std::string> FixturesSetup;
std::set<std::string> FixturesCleanup;
std::set<std::string> FixturesRequired;