diff options
author | Brad King <brad.king@kitware.com> | 2020-06-01 11:48:19 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-06-01 11:48:25 (GMT) |
commit | e773892ccb3ed2b23cc7760dc7e7e15256fa25dd (patch) | |
tree | 751b6765ecde85b43e880a39bfed7e98ac14f825 /Source | |
parent | 5dfb4dc2d118d6ea1f32fd4a89c18cdb5fff1c36 (diff) | |
parent | ed6d20ddcb940f02ff7c2690b38f8aaf1a6f615a (diff) | |
download | CMake-e773892ccb3ed2b23cc7760dc7e7e15256fa25dd.zip CMake-e773892ccb3ed2b23cc7760dc7e7e15256fa25dd.tar.gz CMake-e773892ccb3ed2b23cc7760dc7e7e15256fa25dd.tar.bz2 |
Merge topic 'non-coverage-lines'
ed6d20ddcb CTest: Handle non-coverage lines in gcov files
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4822
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CTest/cmCTestCoverageHandler.cxx | 10 |
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); |