summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmParseCacheCoverage.cxx
diff options
context:
space:
mode:
authorJoseph Snyder <joe.snyder@kitware.com>2014-05-14 13:28:07 (GMT)
committerBrad King <brad.king@kitware.com>2014-05-16 14:16:40 (GMT)
commit9ad07fbeb8166e01f8d22a1fa78b29f6cfa7721e (patch)
treea460788b53cf70d55424951760e4c6d64234862a /Source/CTest/cmParseCacheCoverage.cxx
parentd3417a270f9556caa87851dd8a27ab007a6162b1 (diff)
downloadCMake-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.cxx14
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;
}