Google test is an informal term for Google C ++ testing framework and an open-source C ++ testing framework recently released by Google. It has the following features:
Google's framework for writing C ++ tests on a variety of platforms (Linux, Mac OS X, windows, cygwin, Windows CE, and Symbian ). based on the xunit architecture. supports automatic test distions, a rich set of assertions, user-defined assertions, death tests, fatal and non-fatal failures, type-parameterized tests, various options for running the tests, and XML test report generation.
Google The testing framework is on different platforms ( Linux , Mac OS X , Windows , Cygwin , Windows CE And Symbian ) For writing C ++ Generated by testing. It is based on Xunit The architecture testing framework supports automatic discovery and testing, a rich set of assertions, and user-defined assertions, Death Test, fatal and non-fatal failure, type parameterized test, various running test options and XML Test Report.
For more information, see its home page:
Http://code.google.com/p/googletest/
Note:
It is easier to use cppunit, boost. Test, and Google test.
The MFC output of cppunit needs to be modified in some places. The header file and implementation file must be modified, and different macro names must be used in different places. Different header files must be included, which is cumbersome.
Boost. Test inherits the tradition of boost libraries. Although it has not been carefully used, it can be seen from the documentation that it is still relatively complex.
Google test is relatively easy. It may be necessary to meet the thought transplanted by JUnit:ProgramYou can use JUnit in the simplest scenario without modifying the existingCodeYou do not need to know much about the library-related content and language features.
Google test's unit test only requires two macros, test () and test_f (). I really admire its conciseness.