I want to find a generic unit tester for c++ programs, for use as a teaching tool. It needs to be lightweight so it doesn’t detract from the actual assignment and easy to use so that it can be picked up quickly by someone new to c++.
I also found this page with a great comparison of C++ Unit Testers for those who want a feature-rich, yet simple tester.
This page will be my summary page, with links to individual pages on any tools that I download and test.
|cutee||4||Looks useful, but won’t compile|
|EasyUnit||7||Clear reporting format and test building syntax. Very simple, but perhaps too simple? Little to no documentation.|
|CUTE||6||Cluttered output and framework. Allows for more variability in test creation. Great documentation!|
|Boost Test||9||Clear, but not attractive, reporting format. Great test building syntax. Allows for helper functions, and is well documented and supported. Takes a long time to compile.|
|C++ Unit Lite||2||Documentation is not enough to compile the library, let alone the examples.|
|UnitTest++||9||Clear, but not attractive, reporting format. Great test building syntax. Allows for helper functions, and is well documented and supported.|
|GoogleTest||9||Great syntax, lots of functionality, good output. Requires fair bit of background work with Makefile|
Clearly, my favorites were BoostTest, UnitTest++, and GoogleTest. They all have very similar coding syntax, with very little hassle to add new tests (although GoogleTest clearly wins here for having the most useful ASSERT macros). BoostTest and UnitTest++ have nearly identical output formatting, which was concise and boring. GoogleTest gave more output than strictly necessary, but with the color coding it was actually nice to read. GoogleTest and UnitTest++ require the creation and linking of libraries, while BoostTest is just a bunch of macros (and thus takes a long time to compile).
So, of course, the final decision comes down to what is most important: functionality or ease of integration (including compilation effort and/or compilation time). For teaching purposes, I think a Makefile could be provided to the students to compensate for library linking complications, so I will probably go with the added functionality of GoogleTest. With more ASSERT options, a wider variety of tests are available for exploration. Plus, the output comes out in color. How can you beat that? 😉