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.
2 files changed
tree: 47102c241f4fdf37506dacc88e475e4feed39c55
  1. .github/
  2. docs/
  3. include/
  4. projects/
  5. scripts/
  6. single_include/
  7. .gitattributes
  8. .gitignore
  9. .travis.yml
  10. appveyor.yml
  11. catch-hand-icon.png
  12. catch-icon-tiny.png
  13. catch-logo-small.png
  14. CMakeLists.txt
  15. LICENSE_1_0.txt
  16. README.md
README.md

catch logo

Github Releases Build Status Build status

The latest, single header, version can be downloaded directly using this link

What's the Catch?

Catch stands for C++ Automated Test Cases in Headers and is a multi-paradigm automated test framework for C++ and Objective-C (and, maybe, C). It is implemented entirely in a set of header files, but is packaged up as a single header for extra convenience.

How to use it

This documentation comprises these three parts:

More