MCPcopy Create free account
hub / github.com/catchorg/Catch2 / writeTestCase

Method writeTestCase

extras/catch_amalgamated.cpp:11142–11166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11140 }
11141
11142 void JunitReporter::writeTestCase( TestCaseNode const& testCaseNode ) {
11143 TestCaseStats const& stats = testCaseNode.value;
11144
11145 // All test cases have exactly one section - which represents the
11146 // test case itself. That section may have 0-n nested sections
11147 assert( testCaseNode.children.size() == 1 );
11148 SectionNode const& rootSection = *testCaseNode.children.front();
11149
11150 std::string className =
11151 static_cast<std::string>( stats.testInfo->className );
11152
11153 if( className.empty() ) {
11154 className = fileNameTag(stats.testInfo->tags);
11155 if ( className.empty() ) {
11156 className = "global";
11157 }
11158 }
11159
11160 if ( !m_config->name().empty() )
11161 className = static_cast<std::string>(m_config->name()) + '.' + className;
11162
11163 normalizeNamespaceMarkers(className);
11164
11165 writeSection( className, "", rootSection, stats.testInfo->okToFail() );
11166 }
11167
11168 void JunitReporter::writeSection( std::string const& className,
11169 std::string const& rootName,

Callers

nothing calls this directly

Calls 6

fileNameTagFunction · 0.70
sizeMethod · 0.45
emptyMethod · 0.45
nameMethod · 0.45
okToFailMethod · 0.45

Tested by

no test coverage detected