mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 05:16:10 +01:00
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)
7a8a0205b4
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. |
||
---|---|---|
.github | ||
docs | ||
include | ||
projects | ||
scripts | ||
single_include | ||
.gitattributes | ||
.gitignore | ||
.travis.yml | ||
appveyor.yml | ||
catch-hand-icon.png | ||
catch-icon-tiny.png | ||
catch-logo-small.png | ||
CMakeLists.txt | ||
LICENSE_1_0.txt | ||
README.md |
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:
- Why do we need yet another C++ Test Framework?
- Tutorial - getting started
- Reference section - all the details
More
- Issues and bugs can be raised on the Issue tracker on GitHub
- For discussion or questions please use the dedicated Google Groups forum
- See who else is using Catch