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.
This commit is contained in:
Rolf Eike Beer 2017-09-19 11:55:53 +02:00 committed by Rolf Eike Beer
parent d44202ef05
commit 6db6301205

View File

@ -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;