C ++ testing framework Selection

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.