Avoid adding a default test spec when none was provided

This commit is contained in:
Martin Hořeňovský
2019-04-09 11:50:59 +02:00
parent b9dd1936e5
commit e99f1efd28
3 changed files with 11 additions and 8 deletions

View File

@@ -72,7 +72,10 @@ namespace Catch {
auto const& allTestCases = getAllTestCasesSorted(*config);
for (auto const& testCase : allTestCases) {
if (!context.aborting() && matchTest(testCase, testSpec, *config))
bool matching = (!testSpec.hasFilters() && !testCase.isHidden()) ||
(testSpec.hasFilters() && matchTest(testCase, testSpec, *config));
if (!context.aborting() && matching)
totals += context.runTest(testCase);
else
context.reporter().skipTest(testCase);