From 6db63012057a82b3528ede3f259684f3429731d5 Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Tue, 19 Sep 2017 11:55:53 +0200 Subject: CTest: fix crash if source file for coverage cannot be found The opened XML elements were not closed, so an assert was triggered when the file was finally closed. If CMake is built with assertions disabled then an invalid XML file will be produced. --- Source/CTest/cmCTestCoverageHandler.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx index 877cd24..28fae1c 100644 --- a/Source/CTest/cmCTestCoverageHandler.cxx +++ b/Source/CTest/cmCTestCoverageHandler.cxx @@ -570,6 +570,8 @@ int cmCTestCoverageHandler::ProcessHandler() ostr << "Cannot open source file: " << fullPath; errorsWhileAccumulating.push_back(ostr.str()); error++; + covLogXML.EndElement(); // Report + covLogXML.EndElement(); // File continue; } int untested = 0; -- cgit v0.12