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

Method TestGroup

extras/catch_amalgamated.cpp:1244–1270  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1242 class TestGroup {
1243 public:
1244 explicit TestGroup(IEventListenerPtr&& reporter, Config const* config):
1245 m_reporter(reporter.get()),
1246 m_config{config},
1247 m_context{config, CATCH_MOVE(reporter)} {
1248
1249 assert( m_config->testSpec().getInvalidSpecs().empty() &&
1250 "Invalid test specs should be handled before running tests" );
1251
1252 auto const& allTestCases = getAllTestCasesSorted(*m_config);
1253 auto const& testSpec = m_config->testSpec();
1254 if ( !testSpec.hasFilters() ) {
1255 for ( auto const& test : allTestCases ) {
1256 if ( !test.getTestCaseInfo().isHidden() ) {
1257 m_tests.emplace( &test );
1258 }
1259 }
1260 } else {
1261 m_matches =
1262 testSpec.matchesByFilter( allTestCases, *m_config );
1263 for ( auto const& match : m_matches ) {
1264 m_tests.insert( match.tests.begin(),
1265 match.tests.end() );
1266 }
1267 }
1268
1269 m_tests = createShard(m_tests, m_config->shardCount(), m_config->shardIndex());
1270 }
1271
1272 Totals execute() {
1273 Totals totals;

Callers

nothing calls this directly

Calls 11

createShardFunction · 0.70
getMethod · 0.45
emptyMethod · 0.45
testSpecMethod · 0.45
hasFiltersMethod · 0.45
isHiddenMethod · 0.45
matchesByFilterMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
shardCountMethod · 0.45
shardIndexMethod · 0.45

Tested by

no test coverage detected