| 16750 | } |
| 16751 | |
| 16752 | void JunitReporter::writeGroup( TestGroupNode const& groupNode, double suiteTime ) { |
| 16753 | XmlWriter::ScopedElement e = xml.scopedElement( "testsuite" ); |
| 16754 | |
| 16755 | TestGroupStats const& stats = groupNode.value; |
| 16756 | xml.writeAttribute( "name", stats.groupInfo.name ); |
| 16757 | xml.writeAttribute( "errors", unexpectedExceptions ); |
| 16758 | xml.writeAttribute( "failures", stats.totals.assertions.failed-unexpectedExceptions ); |
| 16759 | xml.writeAttribute( "tests", stats.totals.assertions.total() ); |
| 16760 | xml.writeAttribute( "hostname", "tbd" ); // !TBD |
| 16761 | if( m_config->showDurations() == ShowDurations::Never ) |
| 16762 | xml.writeAttribute( "time", "" ); |
| 16763 | else |
| 16764 | xml.writeAttribute( "time", suiteTime ); |
| 16765 | xml.writeAttribute( "timestamp", getCurrentTimestamp() ); |
| 16766 | |
| 16767 | // Write properties if there are any |
| 16768 | if (m_config->hasTestFilters() || m_config->rngSeed() != 0) { |
| 16769 | auto properties = xml.scopedElement("properties"); |
| 16770 | if (m_config->hasTestFilters()) { |
| 16771 | xml.scopedElement("property") |
| 16772 | .writeAttribute("name", "filters") |
| 16773 | .writeAttribute("value", serializeFilters(m_config->getTestsOrTags())); |
| 16774 | } |
| 16775 | if (m_config->rngSeed() != 0) { |
| 16776 | xml.scopedElement("property") |
| 16777 | .writeAttribute("name", "random-seed") |
| 16778 | .writeAttribute("value", m_config->rngSeed()); |
| 16779 | } |
| 16780 | } |
| 16781 | |
| 16782 | // Write test cases |
| 16783 | for( auto const& child : groupNode.children ) |
| 16784 | writeTestCase( *child ); |
| 16785 | |
| 16786 | xml.scopedElement( "system-out" ).writeText( trim( stdOutForSuite ), XmlFormatting::Newline ); |
| 16787 | xml.scopedElement( "system-err" ).writeText( trim( stdErrForSuite ), XmlFormatting::Newline ); |
| 16788 | } |
| 16789 | |
| 16790 | void JunitReporter::writeTestCase( TestCaseNode const& testCaseNode ) { |
| 16791 | TestCaseStats const& stats = testCaseNode.value; |
nothing calls this directly
no test coverage detected