diff options
| author | Martin Hořeňovský | 2017-03-17 13:21:40 +0100 |
|---|---|---|
| committer | Martin Hořeňovský | 2017-03-17 13:21:40 +0100 |
| commit | 7a8a0205b46a3770cc8f0d26a24a903a4c03e82a (patch) | |
| tree | 47102c241f4fdf37506dacc88e475e4feed39c55 /projects/SelfTest/StringRef.tests.cpp | |
| parent | 4dc06bdb7034d36071caa2219f14c4b2ce52c80a (diff) | |
| download | catch3-7a8a0205b46a3770cc8f0d26a24a903a4c03e82a.tar.gz | |
CATCH_CONFIG_FAST_COMPILE now disables trys in REQUIRE*
This seems to give about 15% speedup when compiling tests using GCC.
The tradeoff is that under certain circumstances, there is a chance for
false negative result, when the expression under test throws exception
and the test code catches it before it gets to the test runner.
Example:
``` cpp
TEST_CASE("False negative") {
try {
REQUIRE(throws() == "");
} catch (...) {}
}
```
This test case will succeed, reporting no assertions checked, instead of
failing as it would with `CATCH_CONFIG_FAST_COMPILE` disabled. However,
just removing the try-catch block inside client's code will fix this, so
it is worthwhile.
This change does not apply to CHECK* macros, because these are currently
specified as continuing on exception and thus need the local try-catch
to work as intended.
Diffstat (limited to 'projects/SelfTest/StringRef.tests.cpp')
0 files changed, 0 insertions, 0 deletions