Prints an XML representation of a TestSuite object
| 5303 | |
| 5304 | // Prints an XML representation of a TestSuite object |
| 5305 | void XmlUnitTestResultPrinter::PrintXmlTestSuite(std::ostream* stream, |
| 5306 | const TestSuite& test_suite) { |
| 5307 | const std::string kTestsuite = "testsuite"; |
| 5308 | *stream << " <" << kTestsuite; |
| 5309 | OutputXmlAttribute(stream, kTestsuite, "name", test_suite.name()); |
| 5310 | OutputXmlAttribute(stream, kTestsuite, "tests", |
| 5311 | StreamableToString(test_suite.reportable_test_count())); |
| 5312 | if (!GTEST_FLAG(list_tests)) { |
| 5313 | OutputXmlAttribute(stream, kTestsuite, "failures", |
| 5314 | StreamableToString(test_suite.failed_test_count())); |
| 5315 | OutputXmlAttribute( |
| 5316 | stream, kTestsuite, "disabled", |
| 5317 | StreamableToString(test_suite.reportable_disabled_test_count())); |
| 5318 | OutputXmlAttribute(stream, kTestsuite, "errors", "0"); |
| 5319 | OutputXmlAttribute(stream, kTestsuite, "time", |
| 5320 | FormatTimeInMillisAsSeconds(test_suite.elapsed_time())); |
| 5321 | *stream << TestPropertiesAsXmlAttributes(test_suite.ad_hoc_test_result()); |
| 5322 | } |
| 5323 | *stream << ">\n"; |
| 5324 | for (int i = 0; i < test_suite.total_test_count(); ++i) { |
| 5325 | if (test_suite.GetTestInfo(i)->is_reportable()) |
| 5326 | OutputXmlTestInfo(stream, test_suite.name(), *test_suite.GetTestInfo(i)); |
| 5327 | } |
| 5328 | *stream << " </" << kTestsuite << ">\n"; |
| 5329 | } |
| 5330 | |
| 5331 | // Prints an XML summary of unit_test to output stream out. |
| 5332 | void XmlUnitTestResultPrinter::PrintXmlUnitTest(std::ostream* stream, |
nothing calls this directly
no test coverage detected