diff options
author | Brad King <brad.king@kitware.com> | 2009-03-02 20:33:03 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-03-02 20:33:03 (GMT) |
commit | 3078fef81c9f6d00aceba5ca16435ba37f1cdf03 (patch) | |
tree | de3236e6ee5ca068cafbaec802ee55b8dec790ea /Source/CTest/cmCTestCoverageHandler.cxx | |
parent | c4596605dfba62ff1bd9b1c72684d1c487ef9542 (diff) | |
download | CMake-3078fef81c9f6d00aceba5ca16435ba37f1cdf03.zip CMake-3078fef81c9f6d00aceba5ca16435ba37f1cdf03.tar.gz CMake-3078fef81c9f6d00aceba5ca16435ba37f1cdf03.tar.bz2 |
BUG: Fix coverage label reports for Bullseye
This teaches CTest to report Labels elements in the Coverage.xml file
for Bullseye coverage results.
Diffstat (limited to 'Source/CTest/cmCTestCoverageHandler.cxx')
-rw-r--r-- | Source/CTest/cmCTestCoverageHandler.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx index 751457f..f39b7e1 100644 --- a/Source/CTest/cmCTestCoverageHandler.cxx +++ b/Source/CTest/cmCTestCoverageHandler.cxx @@ -1540,6 +1540,8 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary( total_untested += (totalFunctions - functionsCalled); std::string fileName = cmSystemTools::GetFilenameName(file.c_str()); + std::string shortFileName = + this->CTest->GetShortPathToFile(file.c_str()); float cper = percentBranch + percentFunction; if(totalBranches > 0) @@ -1564,8 +1566,7 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary( tmpLog << "percentCoverage: " << percent_coverage << "\n"; tmpLog << "coverage metric: " << cmet << "\n"; covSumFile << "\t<File Name=\"" << cmXMLSafe(sourceFile) - << "\" FullPath=\"" << cmXMLSafe( - this->CTest->GetShortPathToFile(file.c_str())) + << "\" FullPath=\"" << cmXMLSafe(shortFileName) << "\" Covered=\"" << (cmet>0?"true":"false") << "\">\n" << "\t\t<BranchesTested>" << branchCovered @@ -1593,8 +1594,9 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary( << "\t\t<CoverageMetric>"; covSumFile.setf(std::ios::fixed, std::ios::floatfield); covSumFile.precision(2); - covSumFile << (cmet) << "</CoverageMetric>\n" - << "\t</File>" << std::endl; + covSumFile << (cmet) << "</CoverageMetric>\n"; + this->WriteXMLLabels(covSumFile, shortFileName); + covSumFile << "\t</File>" << std::endl; } } std::string end_time = this->CTest->CurrentTime(); |