Prints an XML representation of a TestPartResult object.
| 5105 | |
| 5106 | // Prints an XML representation of a TestPartResult object. |
| 5107 | void XmlUnitTestResultPrinter::OutputXmlTestPartResult(::std::ostream* stream, |
| 5108 | const BaseTestPartResult *base_test_part_result){ |
| 5109 | const TestPartResult* part = DownCast_<const TestPartResult*>(base_test_part_result); |
| 5110 | if(part != NULL){ |
| 5111 | const string location = internal::FormatCompilerIndependentFileLocation( |
| 5112 | part->file_name(), part->line_number()); |
| 5113 | const string summary = location + "\n" + part->summary(); |
| 5114 | *stream << " <failure message=\"" |
| 5115 | << EscapeXmlAttribute(summary.c_str()) |
| 5116 | << "\" type=\"" |
| 5117 | << ((base_test_part_result->type() == BaseTestPartResult::kFatalFailure) ? "fatal_failure\">" : "non_fatal_failure\">"); |
| 5118 | const string detail = location + "\n" + part->message(); |
| 5119 | OutputXmlCDataSection(stream, RemoveInvalidXmlCharacters(detail).c_str()); |
| 5120 | *stream << "</failure>\n"; |
| 5121 | } |
| 5122 | } |
| 5123 | |
| 5124 | // Prints an XML representation of a TestCase object |
| 5125 | void XmlUnitTestResultPrinter::PrintXmlTestCase(std::ostream* stream, |
no test coverage detected