| 9031 | } |
| 9032 | |
| 9033 | Catch::Totals runTests(std::shared_ptr<Config> const &config) { |
| 9034 | // FixMe: Add listeners in order first, then add reporters. |
| 9035 | |
| 9036 | auto reporter = makeReporter(config); |
| 9037 | |
| 9038 | RunContext context(config, std::move(reporter)); |
| 9039 | |
| 9040 | Totals totals; |
| 9041 | |
| 9042 | context.testGroupStarting(config->name(), 1, 1); |
| 9043 | |
| 9044 | TestSpec testSpec = config->testSpec(); |
| 9045 | |
| 9046 | auto const &allTestCases = getAllTestCasesSorted(*config); |
| 9047 | for (auto const &testCase : allTestCases) { |
| 9048 | if (!context.aborting() && matchTest(testCase, testSpec, *config)) |
| 9049 | totals += context.runTest(testCase); |
| 9050 | else |
| 9051 | context.reporter().skipTest(testCase); |
| 9052 | } |
| 9053 | |
| 9054 | if (config->warnAboutNoTests() && totals.testCases.total() == 0) { |
| 9055 | ReusableStringStream testConfig; |
| 9056 | |
| 9057 | bool first = true; |
| 9058 | for (const auto &input : config->getTestsOrTags()) { |
| 9059 | if (!first) { |
| 9060 | testConfig << ' '; |
| 9061 | } |
| 9062 | first = false; |
| 9063 | testConfig << input; |
| 9064 | } |
| 9065 | |
| 9066 | context.reporter().noMatchingTestCases(testConfig.str()); |
| 9067 | totals.error = -1; |
| 9068 | } |
| 9069 | |
| 9070 | context.testGroupEnded(config->name(), totals, 1, 1); |
| 9071 | return totals; |
| 9072 | } |
| 9073 | |
| 9074 | void applyFilenamesAsTags(Catch::IConfig const &config) { |
| 9075 | auto &tests = const_cast<std::vector<TestCase> &>(getAllTestCasesSorted(config)); |
no test coverage detected