diff options
author | Vitaly Stakhovsky <vvs31415@users.noreply.gitlab.com> | 2023-01-15 15:13:14 (GMT) |
---|---|---|
committer | Vitaly Stakhovsky <vvs31415@users.noreply.gitlab.com> | 2023-01-16 04:39:02 (GMT) |
commit | b3edfcf46ec1514a376d4e3dca7538cc750844d5 (patch) | |
tree | c5a26d80efd9bbeb2783d8e6508097a2d9ee0b09 /Source/CTest | |
parent | 701badbd20a33d8f955cb6d86016d5bf415b8212 (diff) | |
download | CMake-b3edfcf46ec1514a376d4e3dca7538cc750844d5.zip CMake-b3edfcf46ec1514a376d4e3dca7538cc750844d5.tar.gz CMake-b3edfcf46ec1514a376d4e3dca7538cc750844d5.tar.bz2 |
cmValue: Use operator* explicitly to convert to std::string; avoid extra call
Diffstat (limited to 'Source/CTest')
-rw-r--r-- | Source/CTest/cmCTestSubmitHandler.cxx | 2 | ||||
-rw-r--r-- | Source/CTest/cmCTestTestHandler.cxx | 19 | ||||
-rw-r--r-- | Source/CTest/cmCTestUpdateHandler.cxx | 4 |
3 files changed, 13 insertions, 12 deletions
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index da085a6..2bc270e 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -718,7 +718,7 @@ int cmCTestSubmitHandler::ProcessHandler() cmValue cdashUploadFile = this->GetOption("CDashUploadFile"); cmValue cdashUploadType = this->GetOption("CDashUploadType"); if (cdashUploadFile && cdashUploadType) { - return this->HandleCDashUploadFile(cdashUploadFile, cdashUploadType); + return this->HandleCDashUploadFile(*cdashUploadFile, *cdashUploadType); } const std::string& buildDirectory = diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index daaf5fd..1c8c713 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -363,10 +363,10 @@ void cmCTestTestHandler::PopulateCustomVectors(cmMakefile* mf) cmValue dval = mf->GetDefinition("CTEST_CUSTOM_TEST_OUTPUT_TRUNCATION"); if (dval) { - if (!this->SetTestOutputTruncation(dval)) { + if (!this->SetTestOutputTruncation(*dval)) { cmCTestLog(this->CTest, ERROR_MESSAGE, "Invalid value for CTEST_CUSTOM_TEST_OUTPUT_TRUNCATION: " - << dval << std::endl); + << *dval << std::endl); } } } @@ -520,7 +520,7 @@ bool cmCTestTestHandler::ProcessOptions() if (cmValue repeat = this->GetOption("Repeat")) { cmsys::RegularExpression repeatRegex( "^(UNTIL_FAIL|UNTIL_PASS|AFTER_TIMEOUT):([0-9]+)$"); - if (repeatRegex.find(repeat)) { + if (repeatRegex.find(*repeat)) { std::string const& count = repeatRegex.match(2); unsigned long n = 1; cmStrToULong(count, &n); // regex guarantees success @@ -537,12 +537,13 @@ bool cmCTestTestHandler::ProcessOptions() } } else { cmCTestLog(this->CTest, ERROR_MESSAGE, - "Repeat option invalid value: " << repeat << std::endl); + "Repeat option invalid value: " << *repeat << std::endl); return false; } } if (this->GetOption("ParallelLevel")) { - this->CTest->SetParallelLevel(std::stoi(this->GetOption("ParallelLevel"))); + this->CTest->SetParallelLevel( + std::stoi(*this->GetOption("ParallelLevel"))); } if (this->GetOption("StopOnFailure")) { @@ -556,12 +557,12 @@ bool cmCTestTestHandler::ProcessOptions() cmValue val = this->GetOption("IncludeRegularExpression"); if (val) { this->UseIncludeRegExp(); - this->SetIncludeRegExp(val); + this->SetIncludeRegExp(*val); } val = this->GetOption("ExcludeRegularExpression"); if (val) { this->UseExcludeRegExp(); - this->SetExcludeRegExp(val); + this->SetExcludeRegExp(*val); } val = this->GetOption("ExcludeFixtureRegularExpression"); if (val) { @@ -2110,9 +2111,9 @@ void cmCTestTestHandler::SetTestsToRunInformation(cmValue in) this->TestsToRunString = *in; // if the argument is a file, then read it and use the contents as the // string - if (cmSystemTools::FileExists(in)) { + if (cmSystemTools::FileExists(*in)) { cmsys::ifstream fin(in->c_str()); - unsigned long filelen = cmSystemTools::FileLength(in); + unsigned long filelen = cmSystemTools::FileLength(*in); auto buff = cm::make_unique<char[]>(filelen + 1); fin.getline(buff.get(), filelen); buff[fin.gcount()] = 0; diff --git a/Source/CTest/cmCTestUpdateHandler.cxx b/Source/CTest/cmCTestUpdateHandler.cxx index d448c76..045eb84 100644 --- a/Source/CTest/cmCTestUpdateHandler.cxx +++ b/Source/CTest/cmCTestUpdateHandler.cxx @@ -123,7 +123,7 @@ int cmCTestUpdateHandler::ProcessHandler() } cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, - " Updating the repository: " << sourceDirectory + " Updating the repository: " << *sourceDirectory << std::endl, this->Quiet); @@ -163,7 +163,7 @@ int cmCTestUpdateHandler::ProcessHandler() break; } vc->SetCommandLineTool(this->UpdateCommand); - vc->SetSourceDirectory(sourceDirectory); + vc->SetSourceDirectory(*sourceDirectory); // Cleanup the working tree. vc->Cleanup(); |