mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-11 16:32:14 -06:00
CTest: pass std::string to cmCTestCoverageHandler::ShouldIDoCoverage()
Avoid needless conversion back and forth.
This commit is contained in:
committed by
Rolf Eike Beer
parent
4547d9a830
commit
062776e75b
@@ -185,9 +185,9 @@ void cmCTestCoverageHandler::EndCoverageLogXML(cmXMLWriter& xml)
|
||||
this->CTest->EndXML(xml);
|
||||
}
|
||||
|
||||
bool cmCTestCoverageHandler::ShouldIDoCoverage(const char* file,
|
||||
const char* srcDir,
|
||||
const char* binDir)
|
||||
bool cmCTestCoverageHandler::ShouldIDoCoverage(std::string const& file,
|
||||
std::string const& srcDir,
|
||||
std::string const& binDir)
|
||||
{
|
||||
if (this->IsFilteredOut(file)) {
|
||||
return false;
|
||||
@@ -435,8 +435,8 @@ int cmCTestCoverageHandler::ProcessHandler()
|
||||
}
|
||||
|
||||
const std::string fullFileName = file.first;
|
||||
bool shouldIDoCoverage = this->ShouldIDoCoverage(
|
||||
fullFileName.c_str(), sourceDir.c_str(), binaryDir.c_str());
|
||||
bool shouldIDoCoverage =
|
||||
this->ShouldIDoCoverage(fullFileName, sourceDir, binaryDir);
|
||||
if (!shouldIDoCoverage) {
|
||||
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
|
||||
".NoDartCoverage found, so skip coverage check for: "
|
||||
@@ -2016,8 +2016,8 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary(
|
||||
file += sourceFile;
|
||||
}
|
||||
file = cmSystemTools::CollapseFullPath(file);
|
||||
bool shouldIDoCoverage = this->ShouldIDoCoverage(
|
||||
file.c_str(), cont->SourceDir.c_str(), cont->BinaryDir.c_str());
|
||||
bool shouldIDoCoverage =
|
||||
this->ShouldIDoCoverage(file, cont->SourceDir, cont->BinaryDir);
|
||||
if (!shouldIDoCoverage) {
|
||||
cmCTestOptionalLog(
|
||||
this->CTest, HANDLER_VERBOSE_OUTPUT,
|
||||
@@ -2318,8 +2318,7 @@ std::set<std::string> cmCTestCoverageHandler::FindUncoveredFiles(
|
||||
gl.FindFiles(glob);
|
||||
std::vector<std::string> files = gl.GetFiles();
|
||||
for (std::string const& f : files) {
|
||||
if (this->ShouldIDoCoverage(f.c_str(), cont->SourceDir.c_str(),
|
||||
cont->BinaryDir.c_str())) {
|
||||
if (this->ShouldIDoCoverage(f, cont->SourceDir, cont->BinaryDir)) {
|
||||
extraMatches.insert(this->CTest->GetShortPathToFile(f.c_str()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,8 +57,8 @@ public:
|
||||
void SetLabelFilter(std::set<std::string> const& labels);
|
||||
|
||||
private:
|
||||
bool ShouldIDoCoverage(const char* file, const char* srcDir,
|
||||
const char* binDir);
|
||||
bool ShouldIDoCoverage(std::string const& file, std::string const& srcDir,
|
||||
std::string const& binDir);
|
||||
void CleanCoverageLogFiles(std::ostream& log);
|
||||
bool StartCoverageLogFile(cmGeneratedFileStream& ostr, int logFileCount);
|
||||
void EndCoverageLogFile(cmGeneratedFileStream& ostr, int logFileCount);
|
||||
|
||||
Reference in New Issue
Block a user