BUG: Fix issue #8363. Wrap output with MakeXMLSafe calls so that the generated XML files are valid, parse-able XML.

This commit is contained in:
David Cole 2009-01-22 07:16:05 -05:00
parent 5f3c354b66
commit 0a23c0ee40
1 changed files with 12 additions and 6 deletions

View File

@ -1503,26 +1503,31 @@ void cmCTestTestHandler::GenerateDartOutput(std::ostream& os)
{
os << "\t\t\t<NamedMeasurement type=\"text/string\" "
"name=\"Exit Code\"><Value>"
<< this->GetTestStatus(result->Status) << "</Value>"
<< cmCTest::MakeXMLSafe(this->GetTestStatus(result->Status))
<< "</Value>"
"</NamedMeasurement>\n"
<< "\t\t\t<NamedMeasurement type=\"text/string\" "
"name=\"Exit Value\"><Value>"
<< result->ReturnValue << "</Value></NamedMeasurement>"
<< result->ReturnValue
<< "</Value></NamedMeasurement>"
<< std::endl;
}
os << result->RegressionImages;
os << "\t\t\t<NamedMeasurement type=\"numeric/double\" "
<< "name=\"Execution Time\"><Value>"
<< result->ExecutionTime << "</Value></NamedMeasurement>\n";
<< result->ExecutionTime
<< "</Value></NamedMeasurement>\n";
os
<< "\t\t\t<NamedMeasurement type=\"text/string\" "
<< "name=\"Completion Status\"><Value>"
<< result->CompletionStatus << "</Value></NamedMeasurement>\n";
<< cmCTest::MakeXMLSafe(result->CompletionStatus)
<< "</Value></NamedMeasurement>\n";
}
os
<< "\t\t\t<NamedMeasurement type=\"text/string\" "
<< "name=\"Command Line\"><Value>"
<< result->FullCommandLine << "</Value></NamedMeasurement>\n";
<< cmCTest::MakeXMLSafe(result->FullCommandLine)
<< "</Value></NamedMeasurement>\n";
std::map<cmStdString,cmStdString>::iterator measureIt;
for ( measureIt = result->Properties->Measurements.begin();
measureIt != result->Properties->Measurements.end();
@ -1531,7 +1536,8 @@ void cmCTestTestHandler::GenerateDartOutput(std::ostream& os)
os
<< "\t\t\t<NamedMeasurement type=\"text/string\" "
<< "name=\"" << measureIt->first.c_str() << "\"><Value>"
<< measureIt->second.c_str() << "</Value></NamedMeasurement>\n";
<< cmCTest::MakeXMLSafe(measureIt->second.c_str())
<< "</Value></NamedMeasurement>\n";
}
os
<< "\t\t\t<Measurement>\n"