C++ unit testing framework [closed]

I’ve just pushed my own framework, CATCH, out there. It’s still under development but I believe it already surpasses most other frameworks.
Different people have different criteria but I’ve tried to cover most ground without too many trade-offs.
Take a look at my linked blog entry for a taster. My top five features are:

  • Header only
  • Auto registration of function and method based tests
  • Decomposes standard C++ expressions into LHS and RHS (so you don’t need a whole family of assert macros).
  • Support for nested sections within a function based fixture
  • Name tests using natural language – function/ method names are generated

It doesn’t do generation of stubs – but that’s a fairly specialised area. I think Isolator++ is the first tool to truly pull that off. Note that Mocking/ stubbing frameworks are usually independent of unit testing frameworks. CATCH works particularly well with mock objects as test state is not passed around by context.

It also has Objective-C bindings.

[update]

Just happened back across this answer of mine from a few years ago. Thanks for all the great comments!
Obviously Catch has developed on a lot in that time. It now has support for BDD style testing (given/ when/ then), tags, now in a single header, and loads of internal improvements and refinements (e.g. richer command line, clear and expressive output etc). A more up-to-date blog post is here.

Leave a Comment