A modern, C++-native, test framework for unit-tests, TDD and BDD - using C++14, C++17 and later (C++11 support is in v2.x branch, and C++03 on the Catch1.x branch)
Go to file
Martin Hořeňovský 7a8a0205b4 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.
2017-03-17 13:21:40 +01:00
.github First draft of issue and PR templates. 2017-01-28 11:42:11 +01:00
docs Reorganised the readme/ ref docs TOC and added link to reporters docs 2017-03-15 09:08:20 +00:00
include CATCH_CONFIG_FAST_COMPILE now disables trys in REQUIRE* 2017-03-17 13:21:40 +01:00
projects Don’t assume first CL arg (exe name) is present 2017-03-13 11:00:58 +00:00
scripts Set execute permission on runnable python scripts 2017-03-15 12:24:18 +01:00
single_include v1.8.2 release 2017-03-13 21:29:30 +01:00
.gitattributes Git Attributes, with control for line-endings 2013-10-18 07:53:05 +01:00
.gitignore Ignore .vs folder 2017-02-21 08:52:08 +00:00
.travis.yml Improved .travis.yml 2017-02-07 11:56:34 +01:00
CMakeLists.txt Save errno before using sprintf, ifstream. 2017-03-06 21:51:22 +01:00
LICENSE_1_0.txt Fixed crlf issue 2013-11-07 13:05:29 +01:00
README.md v1.8.2 release 2017-03-13 21:29:30 +01:00
appveyor.yml Added appveyor.yml for CI with VS {2013, 2015} for {Win32, x64} 2017-02-14 09:37:37 +01:00
catch-hand-icon.png Updated artwork 2017-03-01 16:47:04 +00:00
catch-icon-tiny.png Updated artwork 2017-03-01 16:47:04 +00:00
catch-logo-small.png Resized main logo again 2017-03-01 17:00:33 +00:00

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