MCPcopy Create free account
hub / github.com/ChaiScript/ChaiScript / runTests

Function runTests

unittests/catch.hpp:9120–9156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9118 }
9119
9120 Catch::Totals runTests(std::shared_ptr<Config> const& config) {
9121 IStreamingReporterPtr reporter = makeReporter(config);
9122 addListeners(reporter, config);
9123
9124 RunContext context(config, std::move(reporter));
9125
9126 Totals totals;
9127
9128 context.testGroupStarting(config->name(), 1, 1);
9129
9130 TestSpec testSpec = config->testSpec();
9131
9132 auto const& allTestCases = getAllTestCasesSorted(*config);
9133 for (auto const& testCase : allTestCases) {
9134 if (!context.aborting() && matchTest(testCase, testSpec, *config))
9135 totals += context.runTest(testCase);
9136 else
9137 context.reporter().skipTest(testCase);
9138 }
9139
9140 if (config->warnAboutNoTests() && totals.testCases.total() == 0) {
9141 ReusableStringStream testConfig;
9142
9143 bool first = true;
9144 for (const auto& input : config->getTestsOrTags()) {
9145 if (!first) { testConfig << ' '; }
9146 first = false;
9147 testConfig << input;
9148 }
9149
9150 context.reporter().noMatchingTestCases(testConfig.str());
9151 totals.error = -1;
9152 }
9153
9154 context.testGroupEnded(config->name(), totals, 1, 1);
9155 return totals;
9156 }
9157
9158 void applyFilenamesAsTags(Catch::IConfig const& config) {
9159 auto& tests = const_cast<std::vector<TestCase>&>(getAllTestCasesSorted(config));

Callers 1

runInternalMethod · 0.85

Calls 14

makeReporterFunction · 0.85
addListenersFunction · 0.85
matchTestFunction · 0.85
testSpecMethod · 0.80
abortingMethod · 0.80
runTestMethod · 0.80
warnAboutNoTestsMethod · 0.80
totalMethod · 0.80
testGroupStartingMethod · 0.45
nameMethod · 0.45
skipTestMethod · 0.45
noMatchingTestCasesMethod · 0.45

Tested by

no test coverage detected