MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / writeGroup

Method writeGroup

extlibs/catch/include/catch/catch.hpp:16056–16092  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16054 }
16055
16056 void JunitReporter::writeGroup( TestGroupNode const& groupNode, double suiteTime ) {
16057 XmlWriter::ScopedElement e = xml.scopedElement( "testsuite" );
16058
16059 TestGroupStats const& stats = groupNode.value;
16060 xml.writeAttribute( "name", stats.groupInfo.name );
16061 xml.writeAttribute( "errors", unexpectedExceptions );
16062 xml.writeAttribute( "failures", stats.totals.assertions.failed-unexpectedExceptions );
16063 xml.writeAttribute( "tests", stats.totals.assertions.total() );
16064 xml.writeAttribute( "hostname", "tbd" ); // !TBD
16065 if( m_config->showDurations() == ShowDurations::Never )
16066 xml.writeAttribute( "time", "" );
16067 else
16068 xml.writeAttribute( "time", suiteTime );
16069 xml.writeAttribute( "timestamp", getCurrentTimestamp() );
16070
16071 // Write properties if there are any
16072 if (m_config->hasTestFilters() || m_config->rngSeed() != 0) {
16073 auto properties = xml.scopedElement("properties");
16074 if (m_config->hasTestFilters()) {
16075 xml.scopedElement("property")
16076 .writeAttribute("name", "filters")
16077 .writeAttribute("value", serializeFilters(m_config->getTestsOrTags()));
16078 }
16079 if (m_config->rngSeed() != 0) {
16080 xml.scopedElement("property")
16081 .writeAttribute("name", "random-seed")
16082 .writeAttribute("value", m_config->rngSeed());
16083 }
16084 }
16085
16086 // Write test cases
16087 for( auto const& child : groupNode.children )
16088 writeTestCase( *child );
16089
16090 xml.scopedElement( "system-out" ).writeText( trim( stdOutForSuite ), false );
16091 xml.scopedElement( "system-err" ).writeText( trim( stdErrForSuite ), false );
16092 }
16093
16094 void JunitReporter::writeTestCase( TestCaseNode const& testCaseNode ) {
16095 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