| 5367 | } |
| 5368 | |
| 5369 | void XmlUnitTestResultPrinter::PrintXmlTestsList( |
| 5370 | std::ostream* stream, const std::vector<TestSuite*>& test_suites) { |
| 5371 | const std::string kTestsuites = "testsuites"; |
| 5372 | |
| 5373 | *stream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; |
| 5374 | *stream << "<" << kTestsuites; |
| 5375 | |
| 5376 | int total_tests = 0; |
| 5377 | for (auto test_suite : test_suites) { |
| 5378 | total_tests += test_suite->total_test_count(); |
| 5379 | } |
| 5380 | OutputXmlAttribute(stream, kTestsuites, "tests", |
| 5381 | StreamableToString(total_tests)); |
| 5382 | OutputXmlAttribute(stream, kTestsuites, "name", "AllTests"); |
| 5383 | *stream << ">\n"; |
| 5384 | |
| 5385 | for (auto test_suite : test_suites) { |
| 5386 | PrintXmlTestSuite(stream, *test_suite); |
| 5387 | } |
| 5388 | *stream << "</" << kTestsuites << ">\n"; |
| 5389 | } |
| 5390 | |
| 5391 | // Produces a string representing the test properties in a result as space |
| 5392 | // delimited XML attributes based on the property key="value" pairs. |
no test coverage detected