summaryrefslogtreecommitdiff
path: root/Source/CTest/cmCTestCoverageHandler.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/CTest/cmCTestCoverageHandler.cxx')
-rw-r--r--Source/CTest/cmCTestCoverageHandler.cxx21
1 files changed, 10 insertions, 11 deletions
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index b839c10ad4..093b2d16dd 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -469,8 +469,8 @@ int cmCTestCoverageHandler::ProcessHandler()
}
const std::string fileName = cmSystemTools::GetFilenameName(fullFileName);
- std::string shortFileName =
- this->CTest->GetShortPathToFile(fullFileName.c_str());
+ const std::string shortFileName =
+ this->CTest->GetShortPathToFile(fullFileName);
const cmCTestCoverageHandlerContainer::SingleFileCoverageVector& fcov =
file.second;
covLogXML.StartElement("File");
@@ -538,7 +538,7 @@ int cmCTestCoverageHandler::ProcessHandler()
covSumXML.StartElement("File");
covSumXML.Attribute("Name", fileName);
covSumXML.Attribute("FullPath",
- this->CTest->GetShortPathToFile(fullFileName.c_str()));
+ this->CTest->GetShortPathToFile(fullFileName));
covSumXML.Attribute("Covered", tested + untested > 0 ? "true" : "false");
covSumXML.Element("LOCTested", tested);
covSumXML.Element("LOCUnTested", untested);
@@ -1887,8 +1887,8 @@ int cmCTestCoverageHandler::RunBullseyeCoverageBranch(
// start the file output
covLogXML.StartElement("File");
covLogXML.Attribute("Name", i->first);
- covLogXML.Attribute(
- "FullPath", this->CTest->GetShortPathToFile(i->second.c_str()));
+ covLogXML.Attribute("FullPath",
+ this->CTest->GetShortPathToFile(i->second));
covLogXML.StartElement("Report");
// write the bullseye header
line = 0;
@@ -2064,8 +2064,7 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary(
total_untested += (totalFunctions - functionsCalled);
std::string fileName = cmSystemTools::GetFilenameName(file);
- std::string shortFileName =
- this->CTest->GetShortPathToFile(file.c_str());
+ std::string shortFileName = this->CTest->GetShortPathToFile(file);
float cper = static_cast<float>(percentBranch + percentFunction);
if (totalBranches > 0) {
@@ -2266,7 +2265,7 @@ void cmCTestCoverageHandler::LoadLabels(const char* dir)
// is the end of the target-wide labels.
inTarget = false;
- source = this->CTest->GetShortPathToFile(line.c_str());
+ source = this->CTest->GetShortPathToFile(line);
// Label the source with the target labels.
LabelSet& labelSet = this->SourceLabels[source];
@@ -2320,7 +2319,7 @@ bool cmCTestCoverageHandler::IsFilteredOut(std::string const& source)
// The source is filtered out if it does not have any labels in
// common with the filter set.
- std::string shortSrc = this->CTest->GetShortPathToFile(source.c_str());
+ std::string shortSrc = this->CTest->GetShortPathToFile(source);
auto li = this->SourceLabels.find(shortSrc);
if (li != this->SourceLabels.end()) {
return !this->IntersectsFilter(li->second);
@@ -2342,14 +2341,14 @@ std::set<std::string> cmCTestCoverageHandler::FindUncoveredFiles(
std::vector<std::string> files = gl.GetFiles();
for (std::string const& f : files) {
if (this->ShouldIDoCoverage(f, cont->SourceDir, cont->BinaryDir)) {
- extraMatches.insert(this->CTest->GetShortPathToFile(f.c_str()));
+ extraMatches.insert(this->CTest->GetShortPathToFile(f));
}
}
}
if (!extraMatches.empty()) {
for (auto const& i : cont->TotalCoverage) {
- std::string shortPath = this->CTest->GetShortPathToFile(i.first.c_str());
+ std::string shortPath = this->CTest->GetShortPathToFile(i.first);
extraMatches.erase(shortPath);
}
}