For a full list of my adventures in search of a c++ unit tester, return to the main page here. This section will focus on one candidate: UnitTest++.
Downloaded unittest-cpp-1.4. Unzipped, entered folder, typed ‘make’, and it just worked. Like magic. Easiest installation of all the unit testers I have found so far =)
Run An Example
The basic download includes many sample tests. Perhaps too many… the scope is somewhat overwhelming. Using the documentation page as a guide, I wrote a few basic tests of my own instead.
The tests were easy to write, and compiled without a problem (when I remembered to link to libUnitTest++.a). I was able to use helper functions, which is always a plus =)
- Great documentation!
- Helper functions allowed within a test (although you would have to use messages to create a useful backtrace)
- Untested, but useful-looking functions for time constraints and array checking
- Continues functions even after catching an error
- Doesn’t take forever to compile! (unlike some others I’ve encountered)
- Requires linking to a library
- Output is not grouped well visually, but does convey the necessary information.