summaryrefslogtreecommitdiffstats
path: root/Source/cmSetTestsPropertiesCommand.cxx
diff options
context:
space:
mode:
authorRegina Pfeifer <regina@mailbox.org>2019-09-12 14:28:59 (GMT)
committerRegina Pfeifer <regina@mailbox.org>2019-09-12 16:16:17 (GMT)
commit573cd4e4b43d8d3b75f6e7c420b5f833cdd2120e (patch)
treee45ae0fdfff920a55ccaffa486a92ae795e73cb5 /Source/cmSetTestsPropertiesCommand.cxx
parent95f23ea5d5a07da503f8e2ab9c52c82086cdcae4 (diff)
downloadCMake-573cd4e4b43d8d3b75f6e7c420b5f833cdd2120e.zip
CMake-573cd4e4b43d8d3b75f6e7c420b5f833cdd2120e.tar.gz
CMake-573cd4e4b43d8d3b75f6e7c420b5f833cdd2120e.tar.bz2
cmSetTestsPropertiesCommand: Port away from cmCommand
Ref: #19499
Diffstat (limited to 'Source/cmSetTestsPropertiesCommand.cxx')
-rw-r--r--Source/cmSetTestsPropertiesCommand.cxx31
1 files changed, 17 insertions, 14 deletions
diff --git a/Source/cmSetTestsPropertiesCommand.cxx b/Source/cmSetTestsPropertiesCommand.cxx
index ed909c6..de61eda 100644
--- a/Source/cmSetTestsPropertiesCommand.cxx
+++ b/Source/cmSetTestsPropertiesCommand.cxx
@@ -5,21 +5,25 @@
#include <iterator>
#include "cmAlgorithms.h"
+#include "cmExecutionStatus.h"
#include "cmMakefile.h"
#include "cmStringAlgorithms.h"
#include "cmTest.h"
-class cmExecutionStatus;
+static bool SetOneTest(const std::string& tname,
+ std::vector<std::string>& propertyPairs, cmMakefile* mf,
+ std::string& errors);
-// cmSetTestsPropertiesCommand
-bool cmSetTestsPropertiesCommand::InitialPass(
- std::vector<std::string> const& args, cmExecutionStatus&)
+bool cmSetTestsPropertiesCommand(std::vector<std::string> const& args,
+ cmExecutionStatus& status)
{
if (args.empty()) {
- this->SetError("called with incorrect number of arguments");
+ status.SetError("called with incorrect number of arguments");
return false;
}
+ cmMakefile& mf = status.GetMakefile();
+
// first collect up the list of files
std::vector<std::string> propertyPairs;
int numFiles = 0;
@@ -29,7 +33,7 @@ bool cmSetTestsPropertiesCommand::InitialPass(
// now loop through the rest of the arguments, new style
++j;
if (std::distance(j, args.end()) % 2 != 0) {
- this->SetError("called with incorrect number of arguments.");
+ status.SetError("called with incorrect number of arguments.");
return false;
}
cmAppend(propertyPairs, j, args.end());
@@ -38,8 +42,8 @@ bool cmSetTestsPropertiesCommand::InitialPass(
numFiles++;
}
if (propertyPairs.empty()) {
- this->SetError("called with illegal arguments, maybe "
- "missing a PROPERTIES specifier?");
+ status.SetError("called with illegal arguments, maybe "
+ "missing a PROPERTIES specifier?");
return false;
}
@@ -47,10 +51,9 @@ bool cmSetTestsPropertiesCommand::InitialPass(
int i;
for (i = 0; i < numFiles; ++i) {
std::string errors;
- bool ret = cmSetTestsPropertiesCommand::SetOneTest(args[i], propertyPairs,
- this->Makefile, errors);
+ bool ret = SetOneTest(args[i], propertyPairs, &mf, errors);
if (!ret) {
- this->SetError(errors);
+ status.SetError(errors);
return ret;
}
}
@@ -58,9 +61,9 @@ bool cmSetTestsPropertiesCommand::InitialPass(
return true;
}
-bool cmSetTestsPropertiesCommand::SetOneTest(
- const std::string& tname, std::vector<std::string>& propertyPairs,
- cmMakefile* mf, std::string& errors)
+static bool SetOneTest(const std::string& tname,
+ std::vector<std::string>& propertyPairs, cmMakefile* mf,
+ std::string& errors)
{
if (cmTest* test = mf->GetTest(tname)) {
// now loop through all the props and set them