summaryrefslogtreecommitdiffstats
path: root/Source/CTest
diff options
context:
space:
mode:
authorJoseph Snyder <joe.snyder@kitware.com>2015-03-06 16:18:19 (GMT)
committerJoseph Snyder <joe.snyder@kitware.com>2015-03-06 16:18:19 (GMT)
commitc771f9d945444f6cfe41195e26653f368aff7f42 (patch)
treeda364095873cd5d70da4b018b4b67f822b31cf86 /Source/CTest
parent8f38b8a4433b26da8f64b705fa82e520c40106d5 (diff)
downloadCMake-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/CTest')
-rw-r--r--Source/CTest/cmParseJacocoCoverage.cxx5
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);