In the process of setting our C++ unit testing framework for the next years we shortlisted GoogleTest and CppUnit. I have some experience with both and my heavy preference is GoogleTest. Anyways to convince my boss I need some facts so I did some reading on the Internet, including the manuals, wiki pages and some of the sources. I came up with a list of GoogleTest advantages and a single CppUnit advantage(graphic test runners). Here they are ordered by perceived usefulness:
- INSTANTIATE_TEST_CASE_P to instantiate a test case with any set of parameters you want, including Cartesian products
- FRIEND_TEST for testing private class members(for all the legacy code)
- turning asserts into breakpoints
- non-fatal asserts
- "out of the box" googlemock integration
- automatic tests detection, no need to enumerate them
- tests can be disabled and enabled
- tests to run can be selected using name patterns
- value/type-parameterized tests
- user-defined predicate asserts
- death tests
- much richer set of asserts
- type asserts
- asserting on subroutines
- additional debug info can be added to asserts using <<
- RecordProperty emits last value of property to the XML output
- SCOPED_TRACE helps understand the context of an assertion failure coming from inside a sub-routine or loop.
- xUnit XML output, can be shown by Jenkins right away without a XSLT transformation in between
- supports custom types printers
- time consumed by test indication(I suspect this is also possible with CppUnit but I haven figured it out yet)
- test event listener API (user-defined plug-ins)
- test shuffling
- no exceptions and RTTI
Am I correct in assuming that all of the above are not supported by CppUnit? Is there an useful GoogleTest feature not available in CppUnit I am missing?
And last but not least: Are there any nice CppUnit features that GoogleTest lacks?
Thanks!