summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestCoverageHandler.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/CTest/cmCTestCoverageHandler.cxx')
-rw-r--r--Source/CTest/cmCTestCoverageHandler.cxx88
1 files changed, 44 insertions, 44 deletions
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index 2c21a13..f0b1124 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -269,7 +269,7 @@ bool cmCTestCoverageHandler::ShouldIDoCoverage(const char* file,
fFile.c_str(), checkDir.c_str());
if ( ndc.size() )
{
- cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Found: " << ndc.c_str()
+ cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Found: " << ndc
<< " so skip coverage of " << file << std::endl);
return false;
}
@@ -308,7 +308,7 @@ bool cmCTestCoverageHandler::ShouldIDoCoverage(const char* file,
fFile.c_str(), checkDir.c_str());
if ( ndc.size() )
{
- cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Found: " << ndc.c_str()
+ cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Found: " << ndc
<< " so skip coverage of: " << file << std::endl);
return false;
}
@@ -477,7 +477,7 @@ int cmCTestCoverageHandler::ProcessHandler()
{
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
".NoDartCoverage found, so skip coverage check for: "
- << fullFileName.c_str()
+ << fullFileName
<< std::endl);
continue;
}
@@ -488,7 +488,7 @@ int cmCTestCoverageHandler::ProcessHandler()
if ( !cmSystemTools::FileExists(fullFileName.c_str()) )
{
cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot find file: "
- << fullFileName.c_str() << std::endl);
+ << fullFileName << std::endl);
continue;
}
@@ -516,7 +516,7 @@ int cmCTestCoverageHandler::ProcessHandler()
if ( !ifs)
{
cmOStringStream ostr;
- ostr << "Cannot open source file: " << fullFileName.c_str();
+ ostr << "Cannot open source file: " << fullFileName;
errorsWhileAccumulating.push_back(ostr.str());
error ++;
continue;
@@ -535,7 +535,7 @@ int cmCTestCoverageHandler::ProcessHandler()
cc != fcov.size() -1 )
{
cmOStringStream ostr;
- ostr << "Problem reading source file: " << fullFileName.c_str()
+ ostr << "Problem reading source file: " << fullFileName
<< " line:" << cc << " out total: " << fcov.size()-1;
errorsWhileAccumulating.push_back(ostr.str());
error ++;
@@ -605,7 +605,7 @@ int cmCTestCoverageHandler::ProcessHandler()
if (!ifs)
{
cmOStringStream ostr;
- ostr << "Cannot open source file: " << fullPath.c_str();
+ ostr << "Cannot open source file: " << fullPath;
errorsWhileAccumulating.push_back(ostr.str());
error ++;
continue;
@@ -613,7 +613,7 @@ int cmCTestCoverageHandler::ProcessHandler()
int untested = 0;
std::string line;
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
- "Actually performing coverage for: " << i->c_str() << std::endl);
+ "Actually performing coverage for: " << *i << std::endl);
while (cmSystemTools::GetLineFromStream(ifs, line))
{
covLogFile << "\t\t<Line Number=\"" << untested << "\" Count=\"0\">"
@@ -647,7 +647,7 @@ int cmCTestCoverageHandler::ProcessHandler()
++ erIt )
{
cmCTestLog(this->CTest, ERROR_MESSAGE,
- " " << erIt->c_str() << std::endl);
+ " " << *erIt << std::endl);
}
}
@@ -719,13 +719,13 @@ void cmCTestCoverageHandler::PopulateCustomVectors(cmMakefile *mf)
++ it )
{
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Add coverage exclude: "
- << it->c_str() << std::endl);
+ << *it << std::endl);
}
for ( it = this->ExtraCoverageGlobs.begin();
it != this->ExtraCoverageGlobs.end(); ++it)
{
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Add coverage glob: "
- << it->c_str() << std::endl);
+ << *it << std::endl);
}
}
@@ -959,17 +959,17 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
std::string output = "";
std::string errors = "";
int retVal = 0;
- *cont->OFS << "* Run coverage for: " << fileDir.c_str() << std::endl;
- *cont->OFS << " Command: " << command.c_str() << std::endl;
+ *cont->OFS << "* Run coverage for: " << fileDir << std::endl;
+ *cont->OFS << " Command: " << command << std::endl;
int res = this->CTest->RunCommand(command.c_str(), &output, &errors,
&retVal, tempDir.c_str(), 0 /*this->TimeOut*/);
- *cont->OFS << " Output: " << output.c_str() << std::endl;
- *cont->OFS << " Errors: " << errors.c_str() << std::endl;
+ *cont->OFS << " Output: " << output << std::endl;
+ *cont->OFS << " Errors: " << errors << std::endl;
if ( ! res )
{
cmCTestLog(this->CTest, ERROR_MESSAGE,
- "Problem running coverage on file: " << it->c_str() << std::endl);
+ "Problem running coverage on file: " << *it << std::endl);
cmCTestLog(this->CTest, ERROR_MESSAGE,
"Command produced error: " << errors << std::endl);
cont->Error ++;
@@ -978,7 +978,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
if ( retVal != 0 )
{
cmCTestLog(this->CTest, ERROR_MESSAGE, "Coverage command returned: "
- << retVal << " while processing: " << it->c_str() << std::endl);
+ << retVal << " while processing: " << *it << std::endl);
cmCTestLog(this->CTest, ERROR_MESSAGE,
"Command produced error: " << cont->Error << std::endl);
}
@@ -999,7 +999,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
std::string sourceFile;
std::string gcovFile;
- cmCTestLog(this->CTest, DEBUG, "Line: [" << line->c_str() << "]"
+ cmCTestLog(this->CTest, DEBUG, "Line: [" << *line << "]"
<< std::endl);
if ( line->size() == 0 )
@@ -1145,7 +1145,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
!cmSystemTools::StringStartsWith(line->c_str(), "Removing "))
{
cmCTestLog(this->CTest, ERROR_MESSAGE,
- "Unknown gcov output line: [" << line->c_str() << "]"
+ "Unknown gcov output line: [" << *line << "]"
<< std::endl);
cont->Error ++;
//abort();
@@ -1238,8 +1238,8 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
if ( IsFileInDir(sourceFile, cont->SourceDir) )
{
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " produced s: "
- << sourceFile.c_str() << std::endl);
- *cont->OFS << " produced in source dir: " << sourceFile.c_str()
+ << sourceFile << std::endl);
+ *cont->OFS << " produced in source dir: " << sourceFile
<< std::endl;
actualSourceFile
= cmSystemTools::CollapseFullPath(sourceFile.c_str());
@@ -1247,8 +1247,8 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
else if ( IsFileInDir(sourceFile, cont->BinaryDir) )
{
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " produced b: "
- << sourceFile.c_str() << std::endl);
- *cont->OFS << " produced in binary dir: " << sourceFile.c_str()
+ << sourceFile << std::endl);
+ *cont->OFS << " produced in binary dir: " << sourceFile
<< std::endl;
actualSourceFile
= cmSystemTools::CollapseFullPath(sourceFile.c_str());
@@ -1262,19 +1262,19 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
"Something went wrong" << std::endl);
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"Cannot find file: ["
- << sourceFile.c_str() << "]" << std::endl);
+ << sourceFile << "]" << std::endl);
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
" in source dir: ["
- << cont->SourceDir.c_str() << "]"
+ << cont->SourceDir << "]"
<< std::endl);
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
" or binary dir: ["
<< cont->BinaryDir.size() << "]"
<< std::endl);
*cont->OFS << " Something went wrong. Cannot find file: "
- << sourceFile.c_str()
- << " in source dir: " << cont->SourceDir.c_str()
- << " or binary dir: " << cont->BinaryDir.c_str() << std::endl;
+ << sourceFile
+ << " in source dir: " << cont->SourceDir
+ << " or binary dir: " << cont->BinaryDir << std::endl;
missingFiles.insert(sourceFile);
}
@@ -1364,24 +1364,24 @@ int cmCTestCoverageHandler::HandleTracePyCoverage(
{
cmCTestLog(this->CTest, ERROR_MESSAGE,
"Cannot find source Python file corresponding to: "
- << fileIt->c_str() << std::endl);
+ << *fileIt << std::endl);
continue;
}
std::string actualSourceFile
= cmSystemTools::CollapseFullPath(fileName.c_str());
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
- " Check coverage for file: " << actualSourceFile.c_str()
+ " Check coverage for file: " << actualSourceFile
<< std::endl);
cmCTestCoverageHandlerContainer::SingleFileCoverageVector* vec
= &cont->TotalCoverage[actualSourceFile];
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
- " in file: " << fileIt->c_str() << std::endl);
+ " in file: " << *fileIt << std::endl);
cmsys::ifstream ifile(fileIt->c_str());
if ( ! ifile )
{
cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot open file: "
- << fileIt->c_str() << std::endl);
+ << *fileIt << std::endl);
}
else
{
@@ -1429,7 +1429,7 @@ int cmCTestCoverageHandler::HandleTracePyCoverage(
// So, this will be set to 0.
cov = 0;
}
- cmCTestLog(this->CTest, DEBUG, "Prefix: " << prefix.c_str()
+ cmCTestLog(this->CTest, DEBUG, "Prefix: " << prefix
<< " cov: " << cov
<< std::endl);
// Read the line number starting at the 10th character of the gcov
@@ -1542,7 +1542,7 @@ int cmCTestCoverageHandler::RunBullseyeCoverageBranch(
{
cmCTestLog(this->CTest, ERROR_MESSAGE,
"Cannot open coverage file: " <<
- outputFile.c_str() << std::endl);
+ outputFile << std::endl);
return 0;
}
std::map<std::string, std::string> fileMap;
@@ -1602,7 +1602,7 @@ int cmCTestCoverageHandler::RunBullseyeCoverageBranch(
count++;
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"Produce coverage for file: "
- << file.c_str() << " " << count
+ << file << " " << count
<< std::endl);
// start the file output
covLogFile << "\t<File Name=\""
@@ -1663,12 +1663,12 @@ int cmCTestCoverageHandler::RunBullseyeCommand(
if(arg)
{
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
- "Run : " << program.c_str() << " " << arg << "\n");
+ "Run : " << program << " " << arg << "\n");
}
else
{
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
- "Run : " << program.c_str() << "\n");
+ "Run : " << program << "\n");
}
// create a process object and start it
cmCTestRunProcess runCoverageSrc;
@@ -1686,7 +1686,7 @@ int cmCTestCoverageHandler::RunBullseyeCommand(
if(!runCoverageSrc.StartProcess())
{
cmCTestLog(this->CTest, ERROR_MESSAGE, "Could not run : "
- << program.c_str() << " " << arg << "\n"
+ << program << " " << arg << "\n"
<< "kwsys process state : "
<< runCoverageSrc.GetProcessState());
return 0;
@@ -1755,7 +1755,7 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary(
{
cmCTestLog(this->CTest, ERROR_MESSAGE,
"Cannot open coverage summary file: " <<
- outputFile.c_str() << std::endl);
+ outputFile << std::endl);
return 0;
}
std::set<std::string> coveredFileNames;
@@ -1796,14 +1796,14 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary(
{
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
".NoDartCoverage found, so skip coverage check for: "
- << file.c_str()
+ << file
<< std::endl);
continue;
}
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"Doing coverage for: "
- << file.c_str()
+ << file
<< std::endl);
coveredFiles.push_back(sourceFile);
@@ -1830,7 +1830,7 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary(
cmet /= 2.0f;
}
cmet /= 100.0f;
- tmpLog << stdline.c_str() << "\n";
+ tmpLog << stdline << "\n";
tmpLog << fileName << "\n";
tmpLog << "functionsCalled: " << functionsCalled/100 << "\n";
tmpLog << "totalFunctions: " << totalFunctions/100 << "\n";
@@ -1957,7 +1957,7 @@ bool cmCTestCoverageHandler::ParseBullsEyeCovsrcLine(
if(pos == inputLine.npos)
{
cmCTestLog(this->CTest, ERROR_MESSAGE, "Error parsing string : "
- << inputLine.c_str() << "\n");
+ << inputLine << "\n");
return false;
}
// the source file has "" around it so extract out the file name
@@ -1991,7 +1991,7 @@ bool cmCTestCoverageHandler::ParseBullsEyeCovsrcLine(
if(pos != inputLine.npos)
{
cmCTestLog(this->CTest, ERROR_MESSAGE, "Error parsing input : "
- << inputLine.c_str() << " last pos not npos = " << pos <<
+ << inputLine << " last pos not npos = " << pos <<
"\n");
}
return true;