From: http://blog.whitejadesoft.com /? P = 225
From: http://www.cppblog.com/jinq0123/archive/2010/04/13/112430.html
C ++ testing framework Selection
(Jinqing's column)
This article summarizes the comparison of various unit test frameworks in the article "rolling ing the C ++ unit testing framework Jungle" (http://gamesfromwithin.com/exploring-the-c-unit-testing-framework-jungle) in tabular form, added the Google test. and added another feature comparison, that is, support for mock objects.
Comparison items:
1. Add new tests to minimize workload
2. Ease of modification and Transplantation
3. Easy to assemble/disassemble the test environment (fixtures)
4. Good control over exceptions and crashes
5. Good assertions
6. Different output modes are supported.
7. Support Test Suite (suites)
8. Support for mock objects
I like cppunit, boost. Test, cppunitlite, and cxxtest.
Only cxxtest supports mock objects. Mock is critical for unit testing.
Also extract a comment on cxxtest (http://www.cppblog.com/shuiyuan2004/archive/2007/08/29/31105.html)
Cxxtest has a low workload to add new tests. It does not need to register test cases. It has good portability and ease of loading and unloading. It also has good ability to control exceptions and crashes. It has good assertions; supports multiple output modes and Test suites.
The biggest advantage: compilation is the test method, and you can double-click the result line to locate the correspondingSource codeIt is quite attractive. It supports multiple outputs and provides more detailed output results. It is easy to write and test;
Disadvantage: Perl is required for testing.CodePerform a syntax scan to generate executable code. You need to use the MAKEFILE file (not required). It is troublesome to prepare.