MCPcopy Create free account
hub / github.com/EmbeddedRPC/erpc / PrintXmlTestCase

Method PrintXmlTestCase

test/common/gtest/gtest.cpp:5125–5148  ·  view source on GitHub ↗

Prints an XML representation of a TestCase object

Source from the content-addressed store, hash-verified

5123
5124// Prints an XML representation of a TestCase object
5125void XmlUnitTestResultPrinter::PrintXmlTestCase(std::ostream* stream,
5126 const TestCase& test_case) {
5127 const std::string kTestsuite = "testsuite";
5128 *stream << " <" << kTestsuite;
5129 OutputXmlAttribute(stream, kTestsuite, "name", test_case.name());
5130 OutputXmlAttribute(stream, kTestsuite, "tests",
5131 StreamableToString(test_case.reportable_test_count()));
5132 OutputXmlAttribute(stream, kTestsuite, "failures",
5133 StreamableToString(test_case.failed_test_count()));
5134 OutputXmlAttribute(
5135 stream, kTestsuite, "disabled",
5136 StreamableToString(test_case.reportable_disabled_test_count()));
5137 OutputXmlAttribute(stream, kTestsuite, "errors", "0");
5138 OutputXmlAttribute(stream, kTestsuite, "time",
5139 FormatTimeInMillisAsSeconds(test_case.elapsed_time()));
5140 *stream << TestPropertiesAsXmlAttributes(test_case.ad_hoc_test_result())
5141 << ">\n";
5142
5143 for (int i = 0; i < test_case.total_test_count(); ++i) {
5144 if (test_case.GetTestInfo(i)->is_reportable())
5145 OutputXmlTestInfo(stream, test_case.name(), *test_case.GetTestInfo(i));
5146 }
5147 *stream << " </" << kTestsuite << ">\n";
5148}
5149
5150// Prints an XML summary of unit_test to output stream out.
5151void XmlUnitTestResultPrinter::PrintXmlUnitTest(std::ostream* stream,

Callers

nothing calls this directly

Calls 9

StreamableToStringFunction · 0.85
nameMethod · 0.80
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