Prints an XML representation of a TestCase object
| 3331 | |
| 3332 | // Prints an XML representation of a TestCase object |
| 3333 | void XmlUnitTestResultPrinter::PrintXmlTestCase(std::ostream* stream, |
| 3334 | const TestCase& test_case) { |
| 3335 | const std::string kTestsuite = "testsuite"; |
| 3336 | *stream << " <" << kTestsuite; |
| 3337 | OutputXmlAttribute(stream, kTestsuite, "name", test_case.name()); |
| 3338 | OutputXmlAttribute(stream, kTestsuite, "tests", |
| 3339 | StreamableToString(test_case.reportable_test_count())); |
| 3340 | OutputXmlAttribute(stream, kTestsuite, "failures", |
| 3341 | StreamableToString(test_case.failed_test_count())); |
| 3342 | OutputXmlAttribute( |
| 3343 | stream, kTestsuite, "disabled", |
| 3344 | StreamableToString(test_case.reportable_disabled_test_count())); |
| 3345 | OutputXmlAttribute(stream, kTestsuite, "errors", "0"); |
| 3346 | OutputXmlAttribute(stream, kTestsuite, "time", |
| 3347 | FormatTimeInMillisAsSeconds(test_case.elapsed_time())); |
| 3348 | *stream << TestPropertiesAsXmlAttributes(test_case.ad_hoc_test_result()) |
| 3349 | << ">\n"; |
| 3350 | |
| 3351 | for (int i = 0; i < test_case.total_test_count(); ++i) { |
| 3352 | if (test_case.GetTestInfo(i)->is_reportable()) |
| 3353 | OutputXmlTestInfo(stream, test_case.name(), *test_case.GetTestInfo(i)); |
| 3354 | } |
| 3355 | *stream << " </" << kTestsuite << ">\n"; |
| 3356 | } |
| 3357 | |
| 3358 | // Prints an XML summary of unit_test to output stream out. |
| 3359 | void XmlUnitTestResultPrinter::PrintXmlUnitTest(std::ostream* stream, |
nothing calls this directly
no test coverage detected