MCPcopy Create free account
hub / github.com/awslabs/aws-lambda-cpp / PrintXmlTestsList

Method PrintXmlTestsList

tests/gtest/gtest-all.cc:5369–5389  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5367}
5368
5369void 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.

Callers 1

Calls 2

StreamableToStringFunction · 0.85
total_test_countMethod · 0.80

Tested by

no test coverage detected