MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / writeGroup

Method writeGroup

extern/Catch2/catch.hpp:16912–16948  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 9

formatDurationFunction · 0.85
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