diff options
author | Joseph Snyder <joe.snyder@kitware.com> | 2014-05-14 13:28:07 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-05-16 14:16:40 (GMT) |
commit | 9ad07fbeb8166e01f8d22a1fa78b29f6cfa7721e (patch) | |
tree | a460788b53cf70d55424951760e4c6d64234862a /Source/CTest/cmParseCacheCoverage.cxx | |
parent | d3417a270f9556caa87851dd8a27ab007a6162b1 (diff) | |
download | CMake-9ad07fbeb8166e01f8d22a1fa78b29f6cfa7721e.zip CMake-9ad07fbeb8166e01f8d22a1fa78b29f6cfa7721e.tar.gz CMake-9ad07fbeb8166e01f8d22a1fa78b29f6cfa7721e.tar.bz2 |
CTest: Fix MUMPS coverage parsing and test
Fix the MUMPS coverage parser:
* Account for tabs after entry points
* Stop double incrementing lines that have explicit calls to the 0 line
* If a line has been previously marked as non executable, but then
contains a count, increment it an extra one to push it back into
the executable code set.
Add a custom routine and corresponding coverage files in the test case.
This file is smaller and has cmcov/mcov files that have data for only
that routine.
Diffstat (limited to 'Source/CTest/cmParseCacheCoverage.cxx')
-rw-r--r-- | Source/CTest/cmParseCacheCoverage.cxx | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Source/CTest/cmParseCacheCoverage.cxx b/Source/CTest/cmParseCacheCoverage.cxx index 85e07ae..d17f169 100644 --- a/Source/CTest/cmParseCacheCoverage.cxx +++ b/Source/CTest/cmParseCacheCoverage.cxx @@ -215,7 +215,19 @@ bool cmParseCacheCoverage::ReadCMCovFile(const char* file) { coverageVector.push_back(-1); } - coverageVector[linenumber] += count; + // Accounts for lines that were previously marked + // as non-executable code (-1). if the parser comes back with + // a non-zero count, increase the count by 1 to push the line + // into the executable code set in addition to the count found. + if(coverageVector[linenumber] == -1 && + count > 0) + { + coverageVector[linenumber] += count+1; + } + else + { + coverageVector[linenumber] += count; + } } return true; } |