Commit c771f9d9 authored by Joe Snyder's avatar Joe Snyder

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.
parent 8f38b8a4
......@@ -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);
......
......@@ -2409,6 +2409,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
"${CMake_BINARY_DIR}/Testing/JacocoCoverage/DartConfiguration.tcl")
file(COPY "${CMake_SOURCE_DIR}/Tests/JacocoCoverage/Coverage"
DESTINATION "${CMake_BINARY_DIR}/Testing/JacocoCoverage")
configure_file("${CMake_BINARY_DIR}/Testing/JacocoCoverage/Coverage/target/site/jacoco.xml.in"
"${CMake_BINARY_DIR}/Testing/JacocoCoverage/Coverage/target/site/jacoco.xml")
add_test(NAME CTestJacocoCoverage
COMMAND cmake -E chdir
${CMake_BINARY_DIR}/Testing/JacocoCoverage
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment