| 10916 | } |
| 10917 | |
| 10918 | Catch::Totals runTests(std::shared_ptr<Config> const& config) { |
| 10919 | auto reporter = makeReporter(config); |
| 10920 | |
| 10921 | RunContext context(config, std::move(reporter)); |
| 10922 | |
| 10923 | Totals totals; |
| 10924 | |
| 10925 | context.testGroupStarting(config->name(), 1, 1); |
| 10926 | |
| 10927 | TestSpec testSpec = config->testSpec(); |
| 10928 | |
| 10929 | auto const& allTestCases = getAllTestCasesSorted(*config); |
| 10930 | for (auto const& testCase : allTestCases) { |
| 10931 | bool matching = (!testSpec.hasFilters() && !testCase.isHidden()) || |
| 10932 | (testSpec.hasFilters() && matchTest(testCase, testSpec, *config)); |
| 10933 | |
| 10934 | if (!context.aborting() && matching) |
| 10935 | totals += context.runTest(testCase); |
| 10936 | else |
| 10937 | context.reporter().skipTest(testCase); |
| 10938 | } |
| 10939 | |
| 10940 | if (config->warnAboutNoTests() && totals.testCases.total() == 0) { |
| 10941 | ReusableStringStream testConfig; |
| 10942 | |
| 10943 | bool first = true; |
| 10944 | for (const auto& input : config->getTestsOrTags()) { |
| 10945 | if (!first) { testConfig << ' '; } |
| 10946 | first = false; |
| 10947 | testConfig << input; |
| 10948 | } |
| 10949 | |
| 10950 | context.reporter().noMatchingTestCases(testConfig.str()); |
| 10951 | totals.error = -1; |
| 10952 | } |
| 10953 | |
| 10954 | context.testGroupEnded(config->name(), totals, 1, 1); |
| 10955 | return totals; |
| 10956 | } |
| 10957 | |
| 10958 | void applyFilenamesAsTags(Catch::IConfig const& config) { |
| 10959 | auto& tests = const_cast<std::vector<TestCase>&>(getAllTestCasesSorted(config)); |
no test coverage detected