Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Boost Test Vs Google Test Framework

I am new to Unit Testing world, basically I am c++ developer working on a large product for almost 3 years, and now I've decided to perform automated unit testing of my code. For this I do lot of research on the internet and came across many tools and frameworks and finally chose the following two: 1) Boost Test Libraries 2) Google Test Framework for c++

Now I am confused as to which to choose from those. If someone uses any of the above then please share your experience.

like image 849
Jame Avatar asked Jan 23 '11 17:01

Jame


People also ask

What testing framework does Google use?

GoogleTest is Google's C++ testing and mocking framework.

Is Google Test a framework?

What is Googletest? It is a test framework i.e., a software tool for writing and running unit tests. It is a library for writing C++ tests. It is based on xUnit architecture which is a set of “Frameworks” for programming and automated execution of test cases.

What is boost test?

Boost unit testing framework (Boost. Test) is a part of the Boost library. It is a fully-functional and scalable framework, with wide range of assertion macros, XML output, and other features. Boost. Test itself lacks mocking functionality, but it can be combined with stand-alone mocking frameworks such as gmock.


2 Answers

The below SO posts pretty much answer your questions

  • Comparison of c++ unit test frameworks
  • Unit testing for C++ code - Tools and methodology
  • C++ unit testing framework
like image 116
Aravind Yarram Avatar answered Oct 14 '22 09:10

Aravind Yarram


If you are already using Boost libraries, then stick to Boost Test Libs. It should take care of most of your logging requirements. Otherwise, Google-test is recommended. I've used it in a large project and found it easier to use. Most importantly compiler-error messages are easier to locate in GTEST; boost uses templates.

I have never written complicated tests using either of these two libraries. For simple tests, any of them would do fine. Although google-test will save you some compile time.

Boost-test with boost-log is really a good combination. Try it!

like image 28
Dilawar Avatar answered Oct 14 '22 10:10

Dilawar