Boost Test Vs Google Test Framework

杀马特。学长 韩版系。学妹 提交于 2019-12-20 08:24:24

问题


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.


回答1:


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



回答2:


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!




回答3:


Suggest you take a look at googlemock, a superset of googletest. Googlemock has all the testing capabilities of googletest plus the mocking capabilities of googlemock.



来源:https://stackoverflow.com/questions/4775253/boost-test-vs-google-test-framework

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!