Improve reporting of unmatched filters (#1684)
This PR ultimately does 3 things * Separately tracks matched tests per each filter part (that is, a set of filters separated by an OR (`,`)), which allows Catch2 to report each of the alternative filters that don't match any tests. * Fixes `-w NoTests` to return non-zero in the process * Adds tests for `-w NoTests`.
This commit is contained in:
parent
cf55cfd76f
commit
6070745cab
10 changed files with 278 additions and 109 deletions
|
@ -36,8 +36,13 @@ namespace Catch {
|
|||
}
|
||||
return sorted;
|
||||
}
|
||||
|
||||
bool isThrowSafe( TestCase const& testCase, IConfig const& config ) {
|
||||
return !testCase.throws() || config.allowThrows();
|
||||
}
|
||||
|
||||
bool matchTest( TestCase const& testCase, TestSpec const& testSpec, IConfig const& config ) {
|
||||
return testSpec.matches( testCase ) && ( config.allowThrows() || !testCase.throws() );
|
||||
return testSpec.matches( testCase ) && isThrowSafe( testCase, config );
|
||||
}
|
||||
|
||||
void enforceNoDuplicateTestCases( std::vector<TestCase> const& functions ) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue