Prints an XML representation of a TestCase object
| 5123 | |
| 5124 | // Prints an XML representation of a TestCase object |
| 5125 | void XmlUnitTestResultPrinter::PrintXmlTestCase(std::ostream* stream, |
| 5126 | const TestCase& test_case) { |
| 5127 | const std::string kTestsuite = "testsuite"; |
| 5128 | *stream << " <" << kTestsuite; |
| 5129 | OutputXmlAttribute(stream, kTestsuite, "name", test_case.name()); |
| 5130 | OutputXmlAttribute(stream, kTestsuite, "tests", |
| 5131 | StreamableToString(test_case.reportable_test_count())); |
| 5132 | OutputXmlAttribute(stream, kTestsuite, "failures", |
| 5133 | StreamableToString(test_case.failed_test_count())); |
| 5134 | OutputXmlAttribute( |
| 5135 | stream, kTestsuite, "disabled", |
| 5136 | StreamableToString(test_case.reportable_disabled_test_count())); |
| 5137 | OutputXmlAttribute(stream, kTestsuite, "errors", "0"); |
| 5138 | OutputXmlAttribute(stream, kTestsuite, "time", |
| 5139 | FormatTimeInMillisAsSeconds(test_case.elapsed_time())); |
| 5140 | *stream << TestPropertiesAsXmlAttributes(test_case.ad_hoc_test_result()) |
| 5141 | << ">\n"; |
| 5142 | |
| 5143 | for (int i = 0; i < test_case.total_test_count(); ++i) { |
| 5144 | if (test_case.GetTestInfo(i)->is_reportable()) |
| 5145 | OutputXmlTestInfo(stream, test_case.name(), *test_case.GetTestInfo(i)); |
| 5146 | } |
| 5147 | *stream << " </" << kTestsuite << ">\n"; |
| 5148 | } |
| 5149 | |
| 5150 | // Prints an XML summary of unit_test to output stream out. |
| 5151 | void XmlUnitTestResultPrinter::PrintXmlUnitTest(std::ostream* stream, |
nothing calls this directly
no test coverage detected