| 16908 | } |
| 16909 | |
| 16910 | void JunitReporter::writeGroup( TestGroupNode const& groupNode, double suiteTime ) { |
| 16911 | XmlWriter::ScopedElement e = xml.scopedElement( "testsuite" ); |
| 16912 | |
| 16913 | TestGroupStats const& stats = groupNode.value; |
| 16914 | xml.writeAttribute( "name", stats.groupInfo.name ); |
| 16915 | xml.writeAttribute( "errors", unexpectedExceptions ); |
| 16916 | xml.writeAttribute( "failures", stats.totals.assertions.failed-unexpectedExceptions ); |
| 16917 | xml.writeAttribute( "tests", stats.totals.assertions.total() ); |
| 16918 | xml.writeAttribute( "hostname", "tbd" ); // !TBD |
| 16919 | if( m_config->showDurations() == ShowDurations::Never ) |
| 16920 | xml.writeAttribute( "time", "" ); |
| 16921 | else |
| 16922 | xml.writeAttribute( "time", formatDuration( suiteTime ) ); |
| 16923 | xml.writeAttribute( "timestamp", getCurrentTimestamp() ); |
| 16924 | |
| 16925 | // Write properties if there are any |
| 16926 | if (m_config->hasTestFilters() || m_config->rngSeed() != 0) { |
| 16927 | auto properties = xml.scopedElement("properties"); |
| 16928 | if (m_config->hasTestFilters()) { |
| 16929 | xml.scopedElement("property") |
| 16930 | .writeAttribute("name", "filters") |
| 16931 | .writeAttribute("value", serializeFilters(m_config->getTestsOrTags())); |
| 16932 | } |
| 16933 | if (m_config->rngSeed() != 0) { |
| 16934 | xml.scopedElement("property") |
| 16935 | .writeAttribute("name", "random-seed") |
| 16936 | .writeAttribute("value", m_config->rngSeed()); |
| 16937 | } |
| 16938 | } |
| 16939 | |
| 16940 | // Write test cases |
| 16941 | for( auto const& child : groupNode.children ) |
| 16942 | writeTestCase( *child ); |
| 16943 | |
| 16944 | xml.scopedElement( "system-out" ).writeText( trim( stdOutForSuite ), XmlFormatting::Newline ); |
| 16945 | xml.scopedElement( "system-err" ).writeText( trim( stdErrForSuite ), XmlFormatting::Newline ); |
| 16946 | } |
| 16947 | |
| 16948 | void JunitReporter::writeTestCase( TestCaseNode const& testCaseNode ) { |
| 16949 | TestCaseStats const& stats = testCaseNode.value; |
nothing calls this directly
no test coverage detected