Fix error: ISO C++ forbids in-class initialization of non-const static member 'm_started'
[catch.git] / docs / why-catch.md
blobb77ca2c2411eec5988ac3d09cf1032fcc8b949bd
1 # Why do we need yet another C++ test framework?
3 Good question. For C++ there are quite a number of established frameworks, including (but not limited to), [CppUnit](http://sourceforge.net/apps/mediawiki/cppunit/index.php?title=Main_Page), [Google Test](http://code.google.com/p/googletest/), [Boost.Test](http://www.boost.org/doc/libs/1_49_0/libs/test/doc/html/index.html), [Aeryn](https://launchpad.net/aeryn), [Cute](http://r2.ifs.hsr.ch/cute), [Fructose](http://fructose.sourceforge.net/) and [many, many more](http://en.wikipedia.org/wiki/List_of_unit_testing_frameworks#C.2B.2B). Even for Objective-C there are a few, including OCUnit - which now comes bundled with XCode.
5 So what does Catch bring to the party that differentiates it from these? Apart from a Catchy name, of course.
7 ## Key Features
9 * Really easy to get started. Just download catch.hpp, #include it and you're away. 
10 * No external dependencies. As long as you can compile C++98 and have a C++ standard library available.
11 * Write test cases as, self-registering, functions or methods.
12 * Divide test cases into sections, each of which is run in isolation (eliminates the need for fixtures!)
13 * Use BDD-style Given-When-Then sections as well as traditional unit test cases.
14 * Only one core assertion macro for comparisons. Standard C/C++ operators are used for the comparison - yet the full expression is decomposed and lhs and rhs values are logged.
16 ## Other core features
18 * Tests are named using free-form strings - no more couching names in legal identifiers.
19 * Tests can be tagged for easily running ad-hoc groups of tests.
20 * Failures can (optionally) break into the debugger on Windows and Mac.
21 * Output is through modular reporter objects. Basic textual and XML reporters are included. Custom reporters can easily be added.
22 * JUnit xml output is supported for integration with third-party tools, such as CI servers.
23 * A default main() function is provided (in a header), but you can supply your own for complete control (e.g. integration into your own test runner GUI).
24 * A command line parser is provided and can still be used if you choose to provided your own main() function.
25 * Catch can test itself.
26 * Alternative assertion macro(s) report failures but don't abort the test case
27 * Floating point tolerance comparisons are built in using an expressive Approx() syntax.
28 * Internal and friendly macros are isolated so name clashes can be managed
29 * Support for Matchers (early stages)
31 ## Objective-C-specific features
33 * Automatically detects if you are using it from an Objective-C project
34 * Works with and without ARC with no additional configuration
35 * Implement test fixtures using Obj-C classes too (like OCUnit)
36 * Additional built in matchers that work with Obj-C types (e.g. string matchers)
38 ## Who else is using Catch?
40 See the list of [open source projects using Catch](opensource-users.md).
42 See the [tutorial](tutorial.md) to get more of a taste of using CATCH in practice 
44 ---
46 [Home](Readme.md)