diff options
author | Oleksandr Koval <oleksandr.koval.dev@gmail.com> | 2021-01-05 12:32:36 (GMT) |
---|---|---|
committer | Oleksandr Koval <oleksandr.koval.dev@gmail.com> | 2021-01-05 12:32:36 (GMT) |
commit | 209daa20b2bd2ee2a76e70af58e895647f7e284f (patch) | |
tree | 081f3192927b19325f40c0da459a11e5b5a5784b /Source/CTest | |
parent | 764ce15ffbe232347a41e40509a2e485bae226f6 (diff) | |
download | CMake-209daa20b2bd2ee2a76e70af58e895647f7e284f.zip CMake-209daa20b2bd2ee2a76e70af58e895647f7e284f.tar.gz CMake-209daa20b2bd2ee2a76e70af58e895647f7e284f.tar.bz2 |
Code style: add missed explicit 'this->'
CMake uses explicit 'this->' style. Using custom clang-tidy check we can
detect and fix places where 'this->' was missed.
Diffstat (limited to 'Source/CTest')
-rw-r--r-- | Source/CTest/cmCTestBZR.cxx | 6 | ||||
-rw-r--r-- | Source/CTest/cmCTestBuildCommand.cxx | 2 | ||||
-rw-r--r-- | Source/CTest/cmCTestCoverageHandler.cxx | 8 | ||||
-rw-r--r-- | Source/CTest/cmCTestLaunchReporter.cxx | 2 | ||||
-rw-r--r-- | Source/CTest/cmCTestMultiProcessHandler.cxx | 24 | ||||
-rw-r--r-- | Source/CTest/cmCTestP4.cxx | 72 | ||||
-rw-r--r-- | Source/CTest/cmCTestRunTest.cxx | 10 | ||||
-rw-r--r-- | Source/CTest/cmCTestSVN.cxx | 8 | ||||
-rw-r--r-- | Source/CTest/cmCTestTestHandler.cxx | 6 | ||||
-rw-r--r-- | Source/CTest/cmParseBlanketJSCoverage.cxx | 4 | ||||
-rw-r--r-- | Source/CTest/cmParseCoberturaCoverage.cxx | 4 | ||||
-rw-r--r-- | Source/CTest/cmParseDelphiCoverage.cxx | 2 | ||||
-rw-r--r-- | Source/CTest/cmProcess.cxx | 2 |
13 files changed, 75 insertions, 75 deletions
diff --git a/Source/CTest/cmCTestBZR.cxx b/Source/CTest/cmCTestBZR.cxx index c533cd7..a353435 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 4151fde..88e2871 100644 --- a/Source/CTest/cmCTestBuildCommand.cxx +++ b/Source/CTest/cmCTestBuildCommand.cxx @@ -137,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 093b2d1..5fb52bf 100644 --- a/Source/CTest/cmCTestCoverageHandler.cxx +++ b/Source/CTest/cmCTestCoverageHandler.cxx @@ -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/cmCTestLaunchReporter.cxx b/Source/CTest/cmCTestLaunchReporter.cxx index 6ec7d0e..f89fc9b 100644 --- a/Source/CTest/cmCTestLaunchReporter.cxx +++ b/Source/CTest/cmCTestLaunchReporter.cxx @@ -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/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index a08cb34..9793c5b 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)) { @@ -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)) { @@ -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 1375be4..50c9c16 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/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index 4d65c9b..4ba0ae1 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -198,7 +198,7 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started) if (this->CTest->GetTestProgressOutput()) { if (!passed) { // 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,8 +211,8 @@ 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); } } @@ -485,8 +485,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 44dfab2..4692dbd 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 84bb791..a8c9df6 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -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(); diff --git a/Source/CTest/cmParseBlanketJSCoverage.cxx b/Source/CTest/cmParseBlanketJSCoverage.cxx index 409025f..3a6651f 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 711a856..9311769 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 016e90c..640873e 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 9ee1c17..c7cbd34 100644 --- a/Source/CTest/cmProcess.cxx +++ b/Source/CTest/cmProcess.cxx @@ -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; |