commit | 7a8a0205b46a3770cc8f0d26a24a903a4c03e82a | [log] [tgz] |
---|---|---|
author | Martin Hořeňovský <martin.horenovsky@gmail.com> | Fri Mar 17 13:21:40 2017 +0100 |
committer | Martin Hořeňovský <martin.horenovsky@gmail.com> | Fri Mar 17 13:21:40 2017 +0100 |
tree | 47102c241f4fdf37506dacc88e475e4feed39c55 | |
parent | 4dc06bdb7034d36071caa2219f14c4b2ce52c80a [diff] |
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.
The latest, single header, version can be downloaded directly using this link
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.
This documentation comprises these three parts: