summaryrefslogtreecommitdiff
path: root/Source/CTest
diff options
context:
space:
mode:
Diffstat (limited to 'Source/CTest')
-rw-r--r--Source/CTest/cmCTestBZR.cxx6
-rw-r--r--Source/CTest/cmCTestBuildCommand.cxx45
-rw-r--r--Source/CTest/cmCTestCoverageHandler.cxx10
-rw-r--r--Source/CTest/cmCTestLaunch.cxx2
-rw-r--r--Source/CTest/cmCTestLaunch.h2
-rw-r--r--Source/CTest/cmCTestLaunchReporter.cxx4
-rw-r--r--Source/CTest/cmCTestLaunchReporter.h2
-rw-r--r--Source/CTest/cmCTestMemCheckHandler.cxx14
-rw-r--r--Source/CTest/cmCTestMemCheckHandler.h2
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.cxx36
-rw-r--r--Source/CTest/cmCTestP4.cxx72
-rw-r--r--Source/CTest/cmCTestResourceGroupsLexerHelper.cxx2
-rw-r--r--Source/CTest/cmCTestRunTest.cxx17
-rw-r--r--Source/CTest/cmCTestSVN.cxx8
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx10
-rw-r--r--Source/CTest/cmCTestUpdateCommand.cxx3
-rw-r--r--Source/CTest/cmParseBlanketJSCoverage.cxx4
-rw-r--r--Source/CTest/cmParseCoberturaCoverage.cxx4
-rw-r--r--Source/CTest/cmParseDelphiCoverage.cxx2
-rw-r--r--Source/CTest/cmProcess.cxx16
-rw-r--r--Source/CTest/cmProcess.h4
21 files changed, 132 insertions, 133 deletions
diff --git a/Source/CTest/cmCTestBZR.cxx b/Source/CTest/cmCTestBZR.cxx
index c533cd7f90..a35343549a 100644
--- a/Source/CTest/cmCTestBZR.cxx
+++ b/Source/CTest/cmCTestBZR.cxx
@@ -104,8 +104,8 @@ private:
{
if (this->RegexCheckOut.find(this->Line)) {
this->BZR->URL = this->RegexCheckOut.match(1);
- CheckOutFound = true;
- } else if (!CheckOutFound && this->RegexParent.find(this->Line)) {
+ this->CheckOutFound = true;
+ } else if (!this->CheckOutFound && this->RegexParent.find(this->Line)) {
this->BZR->URL = this->RegexParent.match(1);
}
return true;
@@ -191,7 +191,7 @@ public:
int InitializeParser() override
{
- int res = cmXMLParser::InitializeParser();
+ int res = this->cmXMLParser::InitializeParser();
if (res) {
XML_SetUnknownEncodingHandler(static_cast<XML_Parser>(this->Parser),
cmBZRXMLParserUnknownEncodingHandler,
diff --git a/Source/CTest/cmCTestBuildCommand.cxx b/Source/CTest/cmCTestBuildCommand.cxx
index 1cc267e95a..88e2871604 100644
--- a/Source/CTest/cmCTestBuildCommand.cxx
+++ b/Source/CTest/cmCTestBuildCommand.cxx
@@ -54,22 +54,21 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
//
cmProp ctestBuildConfiguration =
this->Makefile->GetDefinition("CTEST_BUILD_CONFIGURATION");
- const std::string* cmakeBuildConfiguration = !this->Configuration.empty()
- ? &this->Configuration
- : (cmNonempty(ctestBuildConfiguration) ? ctestBuildConfiguration
- : &this->CTest->GetConfigType());
-
- const std::string* cmakeBuildAdditionalFlags = !this->Flags.empty()
- ? &this->Flags
- : this->Makefile->GetDefinition("CTEST_BUILD_FLAGS");
- const std::string* cmakeBuildTarget = !this->Target.empty()
- ? &this->Target
- : this->Makefile->GetDefinition("CTEST_BUILD_TARGET");
+ std::string cmakeBuildConfiguration = cmNonempty(this->Configuration)
+ ? this->Configuration
+ : cmNonempty(ctestBuildConfiguration) ? *ctestBuildConfiguration
+ : this->CTest->GetConfigType();
+
+ const std::string& cmakeBuildAdditionalFlags = cmNonempty(this->Flags)
+ ? this->Flags
+ : this->Makefile->GetSafeDefinition("CTEST_BUILD_FLAGS");
+ const std::string& cmakeBuildTarget = cmNonempty(this->Target)
+ ? this->Target
+ : this->Makefile->GetSafeDefinition("CTEST_BUILD_TARGET");
if (cmNonempty(cmakeGeneratorName)) {
- if (!cmakeBuildConfiguration) {
- static const std::string sRelease = "Release";
- cmakeBuildConfiguration = &sRelease;
+ if (cmakeBuildConfiguration.empty()) {
+ cmakeBuildConfiguration = "Release";
}
if (this->GlobalGenerator) {
if (this->GlobalGenerator->GetName() != *cmakeGeneratorName) {
@@ -88,24 +87,18 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
return nullptr;
}
}
- if (cmakeBuildConfiguration->empty()) {
- const std::string* config = nullptr;
+ if (cmakeBuildConfiguration.empty()) {
#ifdef CMAKE_INTDIR
- static const std::string sIntDir = CMAKE_INTDIR;
- config = &sIntDir;
+ cmakeBuildConfiguration = CMAKE_INTDIR;
+#else
+ cmakeBuildConfiguration = "Debug";
#endif
- if (!config) {
- static const std::string sDebug = "Debug";
- config = &sDebug;
- }
- cmakeBuildConfiguration = config;
}
std::string dir = this->CTest->GetCTestConfiguration("BuildDirectory");
std::string buildCommand =
this->GlobalGenerator->GenerateCMakeBuildCommand(
- cmakeBuildTarget ? *cmakeBuildTarget : "", *cmakeBuildConfiguration,
- cmakeBuildAdditionalFlags ? *cmakeBuildAdditionalFlags : "",
+ cmakeBuildTarget, cmakeBuildConfiguration, cmakeBuildAdditionalFlags,
this->Makefile->IgnoreErrorsCMP0061());
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"SetMakeCommand:" << buildCommand << "\n",
@@ -144,7 +137,7 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
bool cmCTestBuildCommand::InitialPass(std::vector<std::string> const& args,
cmExecutionStatus& status)
{
- bool ret = cmCTestHandlerCommand::InitialPass(args, status);
+ bool ret = this->cmCTestHandlerCommand::InitialPass(args, status);
if (!this->NumberErrors.empty()) {
this->Makefile->AddDefinition(
this->NumberErrors, std::to_string(this->Handler->GetTotalErrors()));
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index 093b2d16dd..3d7d0312b3 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -107,7 +107,7 @@ public:
this->PipeState = cmsysProcess_WaitForExit(this->Process, timeout);
return this->PipeState;
}
- int GetProcessState() { return this->PipeState; }
+ int GetProcessState() const { return this->PipeState; }
private:
int PipeState;
@@ -778,16 +778,16 @@ struct cmCTestCoverageHandlerLocale
{
std::string l;
if (cmSystemTools::GetEnv("LC_ALL", l)) {
- lc_all = l;
+ this->lc_all = l;
}
- if (lc_all != "C") {
+ if (this->lc_all != "C") {
cmSystemTools::PutEnv("LC_ALL=C");
}
}
~cmCTestCoverageHandlerLocale()
{
- if (!lc_all.empty()) {
- cmSystemTools::PutEnv("LC_ALL=" + lc_all);
+ if (!this->lc_all.empty()) {
+ cmSystemTools::PutEnv("LC_ALL=" + this->lc_all);
} else {
cmSystemTools::UnsetEnv("LC_ALL");
}
diff --git a/Source/CTest/cmCTestLaunch.cxx b/Source/CTest/cmCTestLaunch.cxx
index b9ed033559..15c443a4c7 100644
--- a/Source/CTest/cmCTestLaunch.cxx
+++ b/Source/CTest/cmCTestLaunch.cxx
@@ -265,7 +265,7 @@ void cmCTestLaunch::LoadScrapeRules()
}
void cmCTestLaunch::LoadScrapeRules(
- const char* purpose, std::vector<cmsys::RegularExpression>& regexps)
+ const char* purpose, std::vector<cmsys::RegularExpression>& regexps) const
{
std::string fname =
cmStrCat(this->Reporter.LogDir, "Custom", purpose, ".txt");
diff --git a/Source/CTest/cmCTestLaunch.h b/Source/CTest/cmCTestLaunch.h
index d18f66d6a9..eabb608156 100644
--- a/Source/CTest/cmCTestLaunch.h
+++ b/Source/CTest/cmCTestLaunch.h
@@ -60,7 +60,7 @@ private:
bool ScrapeRulesLoaded;
void LoadScrapeRules();
void LoadScrapeRules(const char* purpose,
- std::vector<cmsys::RegularExpression>& regexps);
+ std::vector<cmsys::RegularExpression>& regexps) const;
bool ScrapeLog(std::string const& fname);
// Helper class to generate the xml fragment.
diff --git a/Source/CTest/cmCTestLaunchReporter.cxx b/Source/CTest/cmCTestLaunchReporter.cxx
index 6ec7d0e395..5334a930ef 100644
--- a/Source/CTest/cmCTestLaunchReporter.cxx
+++ b/Source/CTest/cmCTestLaunchReporter.cxx
@@ -150,7 +150,7 @@ void cmCTestLaunchReporter::WriteXML()
this->WriteXMLLabels(e2);
}
-void cmCTestLaunchReporter::WriteXMLAction(cmXMLElement& e2)
+void cmCTestLaunchReporter::WriteXMLAction(cmXMLElement& e2) const
{
e2.Comment("Meta-information about the build action");
cmXMLElement e3(e2, "Action");
@@ -284,7 +284,7 @@ void cmCTestLaunchReporter::DumpFileToXML(cmXMLElement& e3, const char* tag,
cmXMLElement e4(e3, tag);
while (cmSystemTools::GetLineFromStream(fin, line)) {
- if (MatchesFilterPrefix(line)) {
+ if (this->MatchesFilterPrefix(line)) {
continue;
}
if (this->Match(line, this->RegexWarningSuppress)) {
diff --git a/Source/CTest/cmCTestLaunchReporter.h b/Source/CTest/cmCTestLaunchReporter.h
index 675a8787e5..4be0d9beb1 100644
--- a/Source/CTest/cmCTestLaunchReporter.h
+++ b/Source/CTest/cmCTestLaunchReporter.h
@@ -70,7 +70,7 @@ public:
// Methods to generate the xml fragment.
void WriteXML();
- void WriteXMLAction(cmXMLElement&);
+ void WriteXMLAction(cmXMLElement&) const;
void WriteXMLCommand(cmXMLElement&);
void WriteXMLResult(cmXMLElement&);
void WriteXMLLabels(cmXMLElement&);
diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx
index 8a30dc0148..125d0034d3 100644
--- a/Source/CTest/cmCTestMemCheckHandler.cxx
+++ b/Source/CTest/cmCTestMemCheckHandler.cxx
@@ -300,7 +300,7 @@ void cmCTestMemCheckHandler::PopulateCustomVectors(cmMakefile* mf)
this->CustomTestsIgnore);
}
-int cmCTestMemCheckHandler::GetDefectCount()
+int cmCTestMemCheckHandler::GetDefectCount() const
{
return this->DefectCount;
}
@@ -1364,9 +1364,15 @@ void cmCTestMemCheckHandler::AppendMemTesterOutput(cmCTestTestResult& res,
}
}
if (this->LogWithPID) {
- cmSystemTools::RemoveFile(ofile);
- cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
- "Remove: " << ofile << "\n", this->Quiet);
+ auto pos = ofile.find_last_of('.');
+ if (pos != std::string::npos) {
+ auto ofileWithoutPid = ofile.substr(0, pos);
+ cmSystemTools::RenameFile(ofile, ofileWithoutPid);
+ cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
+ "Renaming: " << ofile << " to: " << ofileWithoutPid
+ << "\n",
+ this->Quiet);
+ }
}
}
diff --git a/Source/CTest/cmCTestMemCheckHandler.h b/Source/CTest/cmCTestMemCheckHandler.h
index 7ab00dbd7a..b200c4394e 100644
--- a/Source/CTest/cmCTestMemCheckHandler.h
+++ b/Source/CTest/cmCTestMemCheckHandler.h
@@ -29,7 +29,7 @@ public:
void Initialize() override;
- int GetDefectCount();
+ int GetDefectCount() const;
protected:
int PreProcessHandler() override;
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx
index a08cb34801..852f9d91d8 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.cxx
+++ b/Source/CTest/cmCTestMultiProcessHandler.cxx
@@ -56,8 +56,8 @@ public:
// Sorts tests in descending order of cost
bool operator()(int index1, int index2) const
{
- return Handler->Properties[index1]->Cost >
- Handler->Properties[index2]->Cost;
+ return this->Handler->Properties[index1]->Cost >
+ this->Handler->Properties[index2]->Cost;
}
private:
@@ -169,7 +169,7 @@ bool cmCTestMultiProcessHandler::StartTestProcess(int test)
this->TestRunningMap[test] = true; // mark the test as running
// now remove the test itself
this->EraseTest(test);
- this->RunningCount += GetProcessorsUsed(test);
+ this->RunningCount += this->GetProcessorsUsed(test);
auto testRun = cm::make_unique<cmCTestRunTest>(*this);
@@ -552,12 +552,12 @@ void cmCTestMultiProcessHandler::StartNextTests()
continue;
}
- size_t processors = GetProcessorsUsed(test);
+ size_t processors = this->GetProcessorsUsed(test);
bool testLoadOk = true;
if (this->TestLoad > 0) {
if (processors <= spareLoad) {
cmCTestLog(this->CTest, DEBUG,
- "OK to run " << GetName(test) << ", it requires "
+ "OK to run " << this->GetName(test) << ", it requires "
<< processors << " procs & system load is: "
<< systemLoad << std::endl);
allTestsFailedTestLoadCheck = false;
@@ -568,7 +568,7 @@ void cmCTestMultiProcessHandler::StartNextTests()
if (processors <= minProcessorsRequired) {
minProcessorsRequired = processors;
- testWithMinProcessors = GetName(test);
+ testWithMinProcessors = this->GetName(test);
}
if (testLoadOk && processors <= numToStart && this->StartTest(test)) {
@@ -621,7 +621,7 @@ void cmCTestMultiProcessHandler::StartNextTests()
void cmCTestMultiProcessHandler::OnTestLoadRetryCB(uv_timer_t* timer)
{
- auto self = static_cast<cmCTestMultiProcessHandler*>(timer->data);
+ auto* self = static_cast<cmCTestMultiProcessHandler*>(timer->data);
self->StartNextTests();
}
@@ -631,7 +631,7 @@ void cmCTestMultiProcessHandler::FinishTestProcess(
this->Completed++;
int test = runner->GetIndex();
- auto properties = runner->GetTestProperties();
+ auto* properties = runner->GetTestProperties();
bool testResult = runner->EndTest(this->Completed, this->Total, started);
if (runner->TimedOutForStopTime()) {
@@ -660,7 +660,7 @@ void cmCTestMultiProcessHandler::FinishTestProcess(
this->WriteCheckpoint(test);
this->DeallocateResources(test);
this->UnlockResources(test);
- this->RunningCount -= GetProcessorsUsed(test);
+ this->RunningCount -= this->GetProcessorsUsed(test);
for (auto p : properties->Affinity) {
this->ProcessorsAvailable.insert(p);
@@ -793,9 +793,9 @@ int cmCTestMultiProcessHandler::SearchByName(std::string const& name)
void cmCTestMultiProcessHandler::CreateTestCostList()
{
if (this->ParallelLevel > 1) {
- CreateParallelTestCostList();
+ this->CreateParallelTestCostList();
} else {
- CreateSerialTestCostList();
+ this->CreateSerialTestCostList();
}
}
@@ -862,7 +862,7 @@ void cmCTestMultiProcessHandler::GetAllTestDependencies(int test,
{
TestSet const& dependencySet = this->Tests[test];
for (int i : dependencySet) {
- GetAllTestDependencies(i, dependencies);
+ this->GetAllTestDependencies(i, dependencies);
dependencies.push_back(i);
}
}
@@ -886,7 +886,7 @@ void cmCTestMultiProcessHandler::CreateSerialTestCostList()
}
TestList dependencies;
- GetAllTestDependencies(test, dependencies);
+ this->GetAllTestDependencies(test, dependencies);
for (int testDependency : dependencies) {
if (!cm::contains(alreadySortedTests, testDependency)) {
@@ -920,7 +920,7 @@ void cmCTestMultiProcessHandler::MarkFinished()
static Json::Value DumpToJsonArray(const std::set<std::string>& values)
{
Json::Value jsonArray = Json::arrayValue;
- for (auto& it : values) {
+ for (const auto& it : values) {
jsonArray.append(it);
}
return jsonArray;
@@ -929,7 +929,7 @@ static Json::Value DumpToJsonArray(const std::set<std::string>& values)
static Json::Value DumpToJsonArray(const std::vector<std::string>& values)
{
Json::Value jsonArray = Json::arrayValue;
- for (auto& it : values) {
+ for (const auto& it : values) {
jsonArray.append(it);
}
return jsonArray;
@@ -939,7 +939,7 @@ static Json::Value DumpRegExToJsonArray(
const std::vector<std::pair<cmsys::RegularExpression, std::string>>& values)
{
Json::Value jsonArray = Json::arrayValue;
- for (auto& it : values) {
+ for (const auto& it : values) {
jsonArray.append(it.second);
}
return jsonArray;
@@ -949,7 +949,7 @@ static Json::Value DumpMeasurementToJsonArray(
const std::map<std::string, std::string>& values)
{
Json::Value jsonArray = Json::arrayValue;
- for (auto& it : values) {
+ for (const auto& it : values) {
Json::Value measurement = Json::objectValue;
measurement["measurement"] = it.first;
measurement["value"] = it.second;
@@ -1274,7 +1274,7 @@ void cmCTestMultiProcessHandler::PrintOutputAsJson()
void cmCTestMultiProcessHandler::PrintTestList()
{
if (this->CTest->GetOutputAsJson()) {
- PrintOutputAsJson();
+ this->PrintOutputAsJson();
return;
}
diff --git a/Source/CTest/cmCTestP4.cxx b/Source/CTest/cmCTestP4.cxx
index 1375be406c..50c9c16f87 100644
--- a/Source/CTest/cmCTestP4.cxx
+++ b/Source/CTest/cmCTestP4.cxx
@@ -56,7 +56,7 @@ public:
ChangesParser(cmCTestP4* p4, const char* prefix)
: P4(p4)
{
- this->SetLog(&P4->Log, prefix);
+ this->SetLog(&this->P4->Log, prefix);
this->RegexIdentify.compile("^Change ([0-9]+) on");
}
@@ -67,7 +67,7 @@ private:
bool ProcessLine() override
{
if (this->RegexIdentify.find(this->Line)) {
- P4->ChangeLists.push_back(this->RegexIdentify.match(1));
+ this->P4->ChangeLists.push_back(this->RegexIdentify.match(1));
}
return true;
}
@@ -79,7 +79,7 @@ public:
UserParser(cmCTestP4* p4, const char* prefix)
: P4(p4)
{
- this->SetLog(&P4->Log, prefix);
+ this->SetLog(&this->P4->Log, prefix);
this->RegexUser.compile("^(.+) <(.*)> \\((.*)\\) accessed (.*)$");
}
@@ -96,7 +96,7 @@ private:
NewUser.EMail = this->RegexUser.match(2);
NewUser.Name = this->RegexUser.match(3);
NewUser.AccessTime = this->RegexUser.match(4);
- P4->Users[this->RegexUser.match(1)] = NewUser;
+ this->P4->Users[this->RegexUser.match(1)] = NewUser;
return false;
}
@@ -120,7 +120,7 @@ public:
: P4(p4)
, AlreadyNotified(false)
{
- this->SetLog(&P4->Log, prefix);
+ this->SetLog(&this->P4->Log, prefix);
this->RegexDiff.compile("^==== (.*)#[0-9]+ - (.*)");
}
@@ -134,12 +134,12 @@ private:
{
if (!this->Line.empty() && this->Line[0] == '=' &&
this->RegexDiff.find(this->Line)) {
- CurrentPath = this->RegexDiff.match(1);
- AlreadyNotified = false;
+ this->CurrentPath = this->RegexDiff.match(1);
+ this->AlreadyNotified = false;
} else {
- if (!AlreadyNotified) {
- P4->DoModification(PathModified, CurrentPath);
- AlreadyNotified = true;
+ if (!this->AlreadyNotified) {
+ this->P4->DoModification(PathModified, this->CurrentPath);
+ this->AlreadyNotified = true;
}
}
return true;
@@ -148,11 +148,11 @@ private:
cmCTestP4::User cmCTestP4::GetUserData(const std::string& username)
{
- auto it = Users.find(username);
+ auto it = this->Users.find(username);
- if (it == Users.end()) {
+ if (it == this->Users.end()) {
std::vector<char const*> p4_users;
- SetP4Options(p4_users);
+ this->SetP4Options(p4_users);
p4_users.push_back("users");
p4_users.push_back("-m");
p4_users.push_back("1");
@@ -161,11 +161,11 @@ cmCTestP4::User cmCTestP4::GetUserData(const std::string& username)
UserParser out(this, "users-out> ");
OutputLogger err(this->Log, "users-err> ");
- RunChild(&p4_users[0], &out, &err);
+ this->RunChild(&p4_users[0], &out, &err);
// The user should now be added to the map. Search again.
- it = Users.find(username);
- if (it == Users.end()) {
+ it = this->Users.find(username);
+ if (it == this->Users.end()) {
return cmCTestP4::User();
}
}
@@ -195,7 +195,7 @@ public:
, P4(p4)
, Section(SectionHeader)
{
- this->SetLog(&P4->Log, prefix);
+ this->SetLog(&this->P4->Log, prefix);
this->RegexHeader.compile("^Change ([0-9]+) by (.+)@(.+) on (.*)$");
this->RegexDiff.compile(R"(^\.\.\. (.*)#[0-9]+ ([^ ]+)$)");
}
@@ -259,7 +259,7 @@ private:
this->Rev.Rev = this->RegexHeader.match(1);
this->Rev.Date = this->RegexHeader.match(4);
- cmCTestP4::User user = P4->GetUserData(this->RegexHeader.match(2));
+ cmCTestP4::User user = this->P4->GetUserData(this->RegexHeader.match(2));
this->Rev.Author = user.Name;
this->Rev.EMail = user.EMail;
@@ -300,38 +300,38 @@ private:
change.Action = 'M';
}
- Changes.push_back(change);
+ this->Changes.push_back(change);
}
}
};
void cmCTestP4::SetP4Options(std::vector<char const*>& CommandOptions)
{
- if (P4Options.empty()) {
+ if (this->P4Options.empty()) {
const char* p4 = this->CommandLineTool.c_str();
- P4Options.emplace_back(p4);
+ this->P4Options.emplace_back(p4);
// The CTEST_P4_CLIENT variable sets the P4 client used when issuing
// Perforce commands, if it's different from the default one.
std::string client = this->CTest->GetCTestConfiguration("P4Client");
if (!client.empty()) {
- P4Options.emplace_back("-c");
- P4Options.push_back(client);
+ this->P4Options.emplace_back("-c");
+ this->P4Options.push_back(client);
}
// Set the message language to be English, in case the P4 admin
// has localized them
- P4Options.emplace_back("-L");
- P4Options.emplace_back("en");
+ this->P4Options.emplace_back("-L");
+ this->P4Options.emplace_back("en");
// The CTEST_P4_OPTIONS variable adds additional Perforce command line
// options before the main command
std::string opts = this->CTest->GetCTestConfiguration("P4Options");
- cm::append(P4Options, cmSystemTools::ParseArguments(opts));
+ cm::append(this->P4Options, cmSystemTools::ParseArguments(opts));
}
CommandOptions.clear();
- for (std::string const& o : P4Options) {
+ for (std::string const& o : this->P4Options) {
CommandOptions.push_back(o.c_str());
}
}
@@ -339,7 +339,7 @@ void cmCTestP4::SetP4Options(std::vector<char const*>& CommandOptions)
std::string cmCTestP4::GetWorkingRevision()
{
std::vector<char const*> p4_identify;
- SetP4Options(p4_identify);
+ this->SetP4Options(p4_identify);
p4_identify.push_back("changes");
p4_identify.push_back("-m");
@@ -354,7 +354,7 @@ std::string cmCTestP4::GetWorkingRevision()
IdentifyParser out(this, "p4_changes-out> ", rev);
OutputLogger err(this->Log, "p4_changes-err> ");
- bool result = RunChild(&p4_identify[0], &out, &err);
+ bool result = this->RunChild(&p4_identify[0], &out, &err);
// If there was a problem contacting the server return "<unknown>"
if (!result) {
@@ -391,7 +391,7 @@ bool cmCTestP4::NoteNewRevision()
bool cmCTestP4::LoadRevisions()
{
std::vector<char const*> p4_changes;
- SetP4Options(p4_changes);
+ this->SetP4Options(p4_changes);
// Use 'p4 changes ...@old,new' to get a list of changelists
std::string range = this->SourceDirectory + "/...";
@@ -417,17 +417,17 @@ bool cmCTestP4::LoadRevisions()
ChangesParser out(this, "p4_changes-out> ");
OutputLogger err(this->Log, "p4_changes-err> ");
- ChangeLists.clear();
+ this->ChangeLists.clear();
this->RunChild(&p4_changes[0], &out, &err);
- if (ChangeLists.empty()) {
+ if (this->ChangeLists.empty()) {
return true;
}
// p4 describe -s ...@1111111,2222222
std::vector<char const*> p4_describe;
- for (std::string const& i : cmReverseRange(ChangeLists)) {
- SetP4Options(p4_describe);
+ for (std::string const& i : cmReverseRange(this->ChangeLists)) {
+ this->SetP4Options(p4_describe);
p4_describe.push_back("describe");
p4_describe.push_back("-s");
p4_describe.push_back(i.c_str());
@@ -443,7 +443,7 @@ bool cmCTestP4::LoadRevisions()
bool cmCTestP4::LoadModifications()
{
std::vector<char const*> p4_diff;
- SetP4Options(p4_diff);
+ this->SetP4Options(p4_diff);
p4_diff.push_back("diff");
@@ -491,7 +491,7 @@ bool cmCTestP4::UpdateImpl()
}
std::vector<char const*> p4_sync;
- SetP4Options(p4_sync);
+ this->SetP4Options(p4_sync);
p4_sync.push_back("sync");
diff --git a/Source/CTest/cmCTestResourceGroupsLexerHelper.cxx b/Source/CTest/cmCTestResourceGroupsLexerHelper.cxx
index 072af42f03..4c26b3f094 100644
--- a/Source/CTest/cmCTestResourceGroupsLexerHelper.cxx
+++ b/Source/CTest/cmCTestResourceGroupsLexerHelper.cxx
@@ -17,7 +17,7 @@ bool cmCTestResourceGroupsLexerHelper::ParseString(const std::string& value)
yyscan_t lexer;
cmCTestResourceGroups_yylex_init_extra(this, &lexer);
- auto state = cmCTestResourceGroups_yy_scan_string(value.c_str(), lexer);
+ auto* state = cmCTestResourceGroups_yy_scan_string(value.c_str(), lexer);
int retval = cmCTestResourceGroups_yylex(lexer);
cmCTestResourceGroups_yy_delete_buffer(state, lexer);
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx
index 4d65c9bda4..5a6c77539f 100644
--- a/Source/CTest/cmCTestRunTest.cxx
+++ b/Source/CTest/cmCTestRunTest.cxx
@@ -139,7 +139,7 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started)
s << "SKIP_RETURN_CODE=" << this->TestProperties->SkipReturnCode;
}
this->TestResult.CompletionStatus = s.str();
- cmCTestLog(this->CTest, HANDLER_OUTPUT, "***Skipped ");
+ outputStream << "***Skipped ";
skipped = true;
} else if (success != this->TestProperties->WillFail) {
this->TestResult.Status = cmCTestTestHandler::COMPLETED;
@@ -195,10 +195,11 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started)
sprintf(buf, "%6.2f sec", this->TestProcess->GetTotalTime().count());
outputStream << buf << "\n";
+ bool passedOrSkipped = passed || skipped;
if (this->CTest->GetTestProgressOutput()) {
- if (!passed) {
+ if (!passedOrSkipped) {
// If the test did not pass, reprint test name and error
- std::string output = GetTestPrefix(completed, total);
+ std::string output = this->GetTestPrefix(completed, total);
std::string testName = this->TestProperties->Name;
const int maxTestNameWidth = this->CTest->GetMaxTestNameWidth();
testName.resize(maxTestNameWidth + 4, '.');
@@ -211,12 +212,12 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started)
cmCTestLog(this->CTest, HANDLER_TEST_PROGRESS_OUTPUT, "\n"); // flush
}
if (completed == total) {
- std::string testName =
- GetTestPrefix(completed, total) + this->TestProperties->Name + "\n";
+ std::string testName = this->GetTestPrefix(completed, total) +
+ this->TestProperties->Name + "\n";
cmCTestLog(this->CTest, HANDLER_TEST_PROGRESS_OUTPUT, testName);
}
}
- if (!this->CTest->GetTestProgressOutput() || !passed) {
+ if (!this->CTest->GetTestProgressOutput() || !passedOrSkipped) {
cmCTestLog(this->CTest, HANDLER_OUTPUT, outputStream.str());
}
@@ -485,8 +486,8 @@ bool cmCTestRunTest::StartTest(size_t completed, size_t total)
<< this->TestProperties->Index << ": "
<< this->TestProperties->Name << std::endl);
} else {
- std::string testName =
- GetTestPrefix(completed, total) + this->TestProperties->Name + "\n";
+ std::string testName = this->GetTestPrefix(completed, total) +
+ this->TestProperties->Name + "\n";
cmCTestLog(this->CTest, HANDLER_TEST_PROGRESS_OUTPUT, testName);
}
diff --git a/Source/CTest/cmCTestSVN.cxx b/Source/CTest/cmCTestSVN.cxx
index 44dfab2e60..4692dbd516 100644
--- a/Source/CTest/cmCTestSVN.cxx
+++ b/Source/CTest/cmCTestSVN.cxx
@@ -286,9 +286,9 @@ bool cmCTestSVN::RunSVNCommand(std::vector<char const*> const& parameters,
args.push_back(nullptr);
if (strcmp(parameters[0], "update") == 0) {
- return RunUpdateCommand(&args[0], out, err);
+ return this->RunUpdateCommand(&args[0], out, err);
}
- return RunChild(&args[0], out, err);
+ return this->RunChild(&args[0], out, err);
}
class cmCTestSVN::LogParser
@@ -328,7 +328,7 @@ private:
this->CData.clear();
if (name == "logentry") {
this->Rev = Revision();
- this->Rev.SVNInfo = &SVNRepo;
+ this->Rev.SVNInfo = &this->SVNRepo;
if (const char* rev =
cmCTestSVN::LogParser::FindAttribute(atts, "revision")) {
this->Rev.Rev = rev;
@@ -354,7 +354,7 @@ private:
this->SVN->DoRevisionSVN(this->Rev, this->Changes);
} else if (!this->CData.empty() && name == "path") {
std::string orig_path(&this->CData[0], this->CData.size());
- std::string new_path = SVNRepo.BuildLocalPath(orig_path);
+ std::string new_path = this->SVNRepo.BuildLocalPath(orig_path);
this->CurChange.Path.assign(new_path);
this->Changes.push_back(this->CurChange);
} else if (!this->CData.empty() && name == "author") {
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index 4d1a589dc2..1cb5d00902 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -122,7 +122,7 @@ bool cmCTestSubdirCommand(std::vector<std::string> const& args,
readit = status.GetMakefile().ReadDependentFile(fname);
}
if (!readit) {
- status.SetError(cmStrCat("Could not find include file: ", fname));
+ status.SetError(cmStrCat("Could not load include file: ", fname));
return false;
}
}
@@ -340,7 +340,7 @@ void cmCTestTestHandler::Initialize()
this->ExcludeFixtureSetupRegExp.clear();
this->ExcludeFixtureCleanupRegExp.clear();
- TestsToRunString.clear();
+ this->TestsToRunString.clear();
this->UseUnion = false;
this->TestList.clear();
}
@@ -877,7 +877,7 @@ bool cmCTestTestHandler::ComputeTestList()
finalList.push_back(tp);
}
- UpdateForFixtures(finalList);
+ this->UpdateForFixtures(finalList);
// Save the total number of tests before exclusions
this->TotalNumberOfTests = this->TestList.size();
@@ -906,7 +906,7 @@ void cmCTestTestHandler::ComputeTestListForRerunFailed()
finalList.push_back(tp);
}
- UpdateForFixtures(finalList);
+ this->UpdateForFixtures(finalList);
// Save the total number of tests before exclusions
this->TotalNumberOfTests = this->TestList.size();
@@ -1675,7 +1675,7 @@ std::string cmCTestTestHandler::FindExecutable(
// if everything else failed, check the users path, but only if a full path
// wasn't specified
if (fullPath.empty() && filepath.empty()) {
- std::string const path = cmSystemTools::FindProgram(filename.c_str());
+ std::string path = cmSystemTools::FindProgram(filename.c_str());
if (!path.empty()) {
resultingConfig.clear();
return path;
diff --git a/Source/CTest/cmCTestUpdateCommand.cxx b/Source/CTest/cmCTestUpdateCommand.cxx
index 6fef90a563..0ba2c417b6 100644
--- a/Source/CTest/cmCTestUpdateCommand.cxx
+++ b/Source/CTest/cmCTestUpdateCommand.cxx
@@ -5,7 +5,6 @@
#include "cmCTest.h"
#include "cmCTestUpdateHandler.h"
#include "cmMakefile.h"
-#include "cmProperty.h"
#include "cmSystemTools.h"
cmCTestGenericHandler* cmCTestUpdateCommand::InitializeHandler()
@@ -18,7 +17,7 @@ cmCTestGenericHandler* cmCTestUpdateCommand::InitializeHandler()
this->CTest->SetCTestConfiguration(
"SourceDirectory",
cmSystemTools::CollapseFullPath(
- cmToCStrSafe(this->Makefile->GetDefinition("CTEST_SOURCE_DIRECTORY"))),
+ this->Makefile->GetSafeDefinition("CTEST_SOURCE_DIRECTORY")),
this->Quiet);
}
std::string source_dir =
diff --git a/Source/CTest/cmParseBlanketJSCoverage.cxx b/Source/CTest/cmParseBlanketJSCoverage.cxx
index 409025f80c..3a6651f8f9 100644
--- a/Source/CTest/cmParseBlanketJSCoverage.cxx
+++ b/Source/CTest/cmParseBlanketJSCoverage.cxx
@@ -66,7 +66,7 @@ public:
}
foundFile = true;
inSource = false;
- filename = getValue(line, 0);
+ filename = this->getValue(line, 0);
} else if ((line.find("coverage") != std::string::npos) && foundFile &&
inSource) {
/*
@@ -78,7 +78,7 @@ public:
* FoundFile and foundSource ensure that
* only the value of the line coverage is captured
*/
- std::string result = getValue(line, 1);
+ std::string result = this->getValue(line, 1);
result = result.substr(2);
if (result == "\"\"") {
// Empty quotation marks indicate that the
diff --git a/Source/CTest/cmParseCoberturaCoverage.cxx b/Source/CTest/cmParseCoberturaCoverage.cxx
index 711a8564ba..93117695c7 100644
--- a/Source/CTest/cmParseCoberturaCoverage.cxx
+++ b/Source/CTest/cmParseCoberturaCoverage.cxx
@@ -66,7 +66,7 @@ protected:
// Check if this is an absolute path that falls within our
// source or binary directories.
- for (std::string const& filePath : FilePaths) {
+ for (std::string const& filePath : this->FilePaths) {
if (cmHasPrefix(filename, filePath)) {
this->CurFileName = filename;
break;
@@ -76,7 +76,7 @@ protected:
if (this->CurFileName.empty()) {
// Check if this is a path that is relative to our source or
// binary directories.
- for (std::string const& filePath : FilePaths) {
+ for (std::string const& filePath : this->FilePaths) {
finalpath = cmStrCat(filePath, "/", filename);
if (cmSystemTools::FileExists(finalpath)) {
this->CurFileName = finalpath;
diff --git a/Source/CTest/cmParseDelphiCoverage.cxx b/Source/CTest/cmParseDelphiCoverage.cxx
index 016e90c02f..640873e2be 100644
--- a/Source/CTest/cmParseDelphiCoverage.cxx
+++ b/Source/CTest/cmParseDelphiCoverage.cxx
@@ -133,7 +133,7 @@ public:
cmsys::Glob gl;
gl.RecurseOn();
gl.RecurseThroughSymlinksOff();
- std::string glob = Coverage.SourceDir + "*/" + filename;
+ std::string glob = this->Coverage.SourceDir + "*/" + filename;
gl.FindFiles(glob);
std::vector<std::string> const& files = gl.GetFiles();
if (files.empty()) {
diff --git a/Source/CTest/cmProcess.cxx b/Source/CTest/cmProcess.cxx
index 9ee1c170c2..16bca01b57 100644
--- a/Source/CTest/cmProcess.cxx
+++ b/Source/CTest/cmProcess.cxx
@@ -152,7 +152,7 @@ bool cmProcess::StartProcess(uv_loop_t& loop, std::vector<size_t>* affinity)
void cmProcess::StartTimer()
{
- auto properties = this->Runner->GetTestProperties();
+ auto* properties = this->Runner->GetTestProperties();
auto msec =
std::chrono::duration_cast<std::chrono::milliseconds>(this->Timeout);
@@ -177,7 +177,7 @@ bool cmProcess::Buffer::GetLine(std::string& line)
// Start a new range for the next line.
++this->Last;
- this->First = Last;
+ this->First = this->Last;
// Return the line extracted.
return true;
@@ -209,7 +209,7 @@ bool cmProcess::Buffer::GetLast(std::string& line)
void cmProcess::OnReadCB(uv_stream_t* stream, ssize_t nread,
const uv_buf_t* buf)
{
- auto self = static_cast<cmProcess*>(stream->data);
+ auto* self = static_cast<cmProcess*>(stream->data);
self->OnRead(nread, buf);
}
@@ -256,7 +256,7 @@ void cmProcess::OnRead(ssize_t nread, const uv_buf_t* buf)
void cmProcess::OnAllocateCB(uv_handle_t* handle, size_t suggested_size,
uv_buf_t* buf)
{
- auto self = static_cast<cmProcess*>(handle->data);
+ auto* self = static_cast<cmProcess*>(handle->data);
self->OnAllocate(suggested_size, buf);
}
@@ -272,7 +272,7 @@ void cmProcess::OnAllocate(size_t /*suggested_size*/, uv_buf_t* buf)
void cmProcess::OnTimeoutCB(uv_timer_t* timer)
{
- auto self = static_cast<cmProcess*>(timer->data);
+ auto* self = static_cast<cmProcess*>(timer->data);
self->OnTimeout();
}
@@ -298,7 +298,7 @@ void cmProcess::OnTimeout()
void cmProcess::OnExitCB(uv_process_t* process, int64_t exit_status,
int term_signal)
{
- auto self = static_cast<cmProcess*>(process->data);
+ auto* self = static_cast<cmProcess*>(process->data);
self->OnExit(exit_status, term_signal);
}
@@ -358,7 +358,7 @@ void cmProcess::ResetStartTime()
this->StartTime = std::chrono::steady_clock::now();
}
-cmProcess::Exception cmProcess::GetExitException()
+cmProcess::Exception cmProcess::GetExitException() const
{
auto exception = Exception::None;
#if defined(_WIN32) && !defined(__CYGWIN__)
@@ -430,7 +430,7 @@ cmProcess::Exception cmProcess::GetExitException()
return exception;
}
-std::string cmProcess::GetExitExceptionString()
+std::string cmProcess::GetExitExceptionString() const
{
std::string exception_str;
#if defined(_WIN32)
diff --git a/Source/CTest/cmProcess.h b/Source/CTest/cmProcess.h
index 9eec9526f5..a44aeb07c2 100644
--- a/Source/CTest/cmProcess.h
+++ b/Source/CTest/cmProcess.h
@@ -67,8 +67,8 @@ public:
Other
};
- Exception GetExitException();
- std::string GetExitExceptionString();
+ Exception GetExitException() const;
+ std::string GetExitExceptionString() const;
std::unique_ptr<cmCTestRunTest> GetRunner()
{