mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-02 21:35:40 +02:00
Implement warning for unmatched test specs
This commit is contained in:
@@ -212,14 +212,22 @@ This option transforms tabs and newline characters into ```\t``` and ```\n``` re
|
||||
## Warnings
|
||||
<pre>-w, --warn <warning name></pre>
|
||||
|
||||
Enables reporting of suspicious test runs. There is currently only one
|
||||
available warning.
|
||||
You can think of Catch2's warnings as the equivalent of `-Werror` (`/WX`)
|
||||
flag for C++ compilers. It turns some suspicious occurences, like a section
|
||||
without assertions, into errors. Because these might be intended, warnings
|
||||
are not enabled by default, but user can opt in.
|
||||
|
||||
There are currently two warnings implemented:
|
||||
|
||||
```
|
||||
NoAssertions // Fail test case / leaf section if no assertions
|
||||
// (e.g. `REQUIRE`) is encountered.
|
||||
NoAssertions // Fail test case / leaf section if no assertions
|
||||
// (e.g. `REQUIRE`) is encountered.
|
||||
UnmatchedTestSpec // Fail test run if any of the CLI test specs did
|
||||
// not match any tests.
|
||||
```
|
||||
|
||||
> `UnmatchedTestSpec` was introduced in Catch2 X.Y.Z.
|
||||
|
||||
|
||||
<a id="reporting-timings"></a>
|
||||
## Reporting timings
|
||||
|
@@ -173,6 +173,7 @@ new design.
|
||||
* When deferred tu runtime, it behaves like `CHECK`, and not like `REQUIRE`.
|
||||
* You can have multiple tests with the same name, as long as other parts of the test identity differ (#1915, #1999, #2175)
|
||||
* Test identity includes test's name, test's tags and and test's class name if applicable.
|
||||
* Added new warning, `UnmatchedTestSpec`, to error on test specs with no matching tests
|
||||
|
||||
|
||||
### Fixes
|
||||
|
Reference in New Issue
Block a user