diff options
author | Joseph Snyder <joe.snyder@kitware.com> | 2015-03-06 16:18:19 (GMT) |
---|---|---|
committer | Joseph Snyder <joe.snyder@kitware.com> | 2015-03-06 16:18:19 (GMT) |
commit | c771f9d945444f6cfe41195e26653f368aff7f42 (patch) | |
tree | da364095873cd5d70da4b018b4b67f822b31cf86 /Source | |
parent | 8f38b8a4433b26da8f64b705fa82e520c40106d5 (diff) | |
download | CMake-c771f9d945444f6cfe41195e26653f368aff7f42.zip CMake-c771f9d945444f6cfe41195e26653f368aff7f42.tar.gz CMake-c771f9d945444f6cfe41195e26653f368aff7f42.tar.bz2 |
CTest: Fix Jacoco Coverage
Rename the example jacoco.xml file to be jacoco.xml.in to stop CMake
from apptempting to calculate Jacoco Coverage when running over itself.
Enclose a push of -1 to the coverage vector to only happen if there is a
fin to calculate for. This prevents a crash if the target file doesn't
exist.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CTest/cmParseJacocoCoverage.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Source/CTest/cmParseJacocoCoverage.cxx b/Source/CTest/cmParseJacocoCoverage.cxx index ec4cfad..31ad9fe 100644 --- a/Source/CTest/cmParseJacocoCoverage.cxx +++ b/Source/CTest/cmParseJacocoCoverage.cxx @@ -78,7 +78,10 @@ class cmParseJacocoCoverage::XMLParser: public cmXMLParser std::string line; FileLinesType& curFileLines = this->Coverage.TotalCoverage[this->CurFileName]; - curFileLines.push_back(-1); + if(fin) + { + curFileLines.push_back(-1); + } while(cmSystemTools::GetLineFromStream(fin, line)) { curFileLines.push_back(-1); |