summaryrefslogtreecommitdiffstats
path: root/Source/CTest
diff options
context:
space:
mode:
authorTobias Ellinghaus <tobias.ellinghaus@k-lens.de>2020-05-29 14:08:47 (GMT)
committerTobias Ellinghaus <tobias.ellinghaus@k-lens.de>2020-05-29 14:08:47 (GMT)
commited6d20ddcb940f02ff7c2690b38f8aaf1a6f615a (patch)
treef7adae784191e538eb3310248e06064197fec9a1 /Source/CTest
parent9656a0f55a3084899af8297bdf4cd3b28622ae11 (diff)
downloadCMake-ed6d20ddcb940f02ff7c2690b38f8aaf1a6f615a.zip
CMake-ed6d20ddcb940f02ff7c2690b38f8aaf1a6f615a.tar.gz
CMake-ed6d20ddcb940f02ff7c2690b38f8aaf1a6f615a.tar.bz2
CTest: Handle non-coverage lines in gcov files
This implements a TODO in gcov file handling.
Diffstat (limited to 'Source/CTest')
-rw-r--r--Source/CTest/cmCTestCoverageHandler.cxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index daa10c9..b839c10 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -1215,8 +1215,6 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
while (cmSystemTools::GetLineFromStream(ifile, nl)) {
cnt++;
- // TODO: Handle gcov 3.0 non-coverage lines
-
// Skip empty lines
if (nl.empty()) {
continue;
@@ -1227,6 +1225,14 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
continue;
}
+ // Handle gcov 3.0 non-coverage lines
+ // non-coverage lines seem to always start with something not
+ // a space and don't have a ':' in the 9th position
+ // TODO: Verify that this is actually a robust metric
+ if (nl[0] != ' ' && nl[9] != ':') {
+ continue;
+ }
+
// Read the coverage count from the beginning of the gcov output
// line
std::string prefix = nl.substr(0, 12);