MCPcopy Create free account
hub / github.com/Profactor/cv-plot / writeGroup

Method writeGroup

CvPlot/ext/catch2/inc/catch.hpp:16556–16592  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16554 }
16555
16556 void JunitReporter::writeGroup( TestGroupNode const& groupNode, double suiteTime ) {
16557 XmlWriter::ScopedElement e = xml.scopedElement( "testsuite" );
16558
16559 TestGroupStats const& stats = groupNode.value;
16560 xml.writeAttribute( "name", stats.groupInfo.name );
16561 xml.writeAttribute( "errors", unexpectedExceptions );
16562 xml.writeAttribute( "failures", stats.totals.assertions.failed-unexpectedExceptions );
16563 xml.writeAttribute( "tests", stats.totals.assertions.total() );
16564 xml.writeAttribute( "hostname", "tbd" ); // !TBD
16565 if( m_config->showDurations() == ShowDurations::Never )
16566 xml.writeAttribute( "time", "" );
16567 else
16568 xml.writeAttribute( "time", suiteTime );
16569 xml.writeAttribute( "timestamp", getCurrentTimestamp() );
16570
16571 // Write properties if there are any
16572 if (m_config->hasTestFilters() || m_config->rngSeed() != 0) {
16573 auto properties = xml.scopedElement("properties");
16574 if (m_config->hasTestFilters()) {
16575 xml.scopedElement("property")
16576 .writeAttribute("name", "filters")
16577 .writeAttribute("value", serializeFilters(m_config->getTestsOrTags()));
16578 }
16579 if (m_config->rngSeed() != 0) {
16580 xml.scopedElement("property")
16581 .writeAttribute("name", "random-seed")
16582 .writeAttribute("value", m_config->rngSeed());
16583 }
16584 }
16585
16586 // Write test cases
16587 for( auto const& child : groupNode.children )
16588 writeTestCase( *child );
16589
16590 xml.scopedElement( "system-out" ).writeText( trim( stdOutForSuite ), XmlFormatting::Newline );
16591 xml.scopedElement( "system-err" ).writeText( trim( stdErrForSuite ), XmlFormatting::Newline );
16592 }
16593
16594 void JunitReporter::writeTestCase( TestCaseNode const& testCaseNode ) {
16595 TestCaseStats const& stats = testCaseNode.value;

Callers

nothing calls this directly

Calls 8

getCurrentTimestampFunction · 0.85
serializeFiltersFunction · 0.85
trimFunction · 0.85
scopedElementMethod · 0.80
showDurationsMethod · 0.80
hasTestFiltersMethod · 0.80
rngSeedMethod · 0.80
totalMethod · 0.45

Tested by

no test coverage detected