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

Method PrintXmlTestSuite

tests/gtest/gtest-all.cc:5305–5329  ·  view source on GitHub ↗

Prints an XML representation of a TestSuite object

Source from the content-addressed store, hash-verified

5303
5304// Prints an XML representation of a TestSuite object
5305void 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.
5332void XmlUnitTestResultPrinter::PrintXmlUnitTest(std::ostream* stream,

Callers

nothing calls this directly

Calls 8

StreamableToStringFunction · 0.85
reportable_test_countMethod · 0.80
failed_test_countMethod · 0.80
elapsed_timeMethod · 0.80
total_test_countMethod · 0.80
GetTestInfoMethod · 0.80

Tested by

no test coverage detected