cmCTest: Cleanup PopulateCustomVectors calls

In `ExecuteTests`, call `PopulateCustomVectors` on the test handler.
in script mode, `cmCTestHandlerCommand::InitialPass` already calls
the function on the handler before processing it.  Hence, calling
the function all handlers in `ReadCustomConfigurationFileTree` is
no longer necessary and can be removed.
This commit is contained in:
Daniel Pfeifer
2024-10-21 21:38:35 +02:00
parent e279ba06dc
commit 812f8cce5a

View File

@@ -143,19 +143,6 @@ struct cmCTest::Private
&this->UploadHandler };
}
std::map<std::string, cmCTestGenericHandler*> GetNamedTestingHandlers()
{
return { { "build", &this->BuildHandler },
{ "coverage", &this->CoverageHandler },
{ "script", &this->ScriptHandler },
{ "test", &this->TestHandler },
{ "update", &this->UpdateHandler },
{ "configure", &this->ConfigureHandler },
{ "memcheck", &this->MemCheckHandler },
{ "submit", &this->SubmitHandler },
{ "upload", &this->UploadHandler } };
}
bool ShowOnly = false;
bool OutputAsJson = false;
int OutputAsJsonVersion = 1;
@@ -2856,6 +2843,7 @@ int cmCTest::ExecuteTests()
cmGlobalGenerator gg(&cm);
cmMakefile mf(&gg, cm.GetCurrentSnapshot());
this->ReadCustomConfigurationFileTree(this->Impl->BinaryDir, &mf);
this->GetTestHandler()->PopulateCustomVectors(&mf);
}
this->GetTestHandler()->SetVerbose(this->Impl->Verbose);
@@ -3000,16 +2988,6 @@ void cmCTest::ReadCustomConfigurationFileTree(const std::string& dir,
}
found = true;
}
if (found) {
for (auto& handler : this->Impl->GetNamedTestingHandlers()) {
cmCTestLog(this, DEBUG,
"* Read custom CTest configuration vectors for handler: "
<< handler.first << " (" << handler.second << ")"
<< std::endl);
handler.second->PopulateCustomVectors(mf);
}
}
}
void cmCTest::PopulateCustomVector(cmMakefile* mf, const std::string& def,