Writing Unit Tests in C ++

Possible duplicate:
Comparing C ++ unit test frameworks

I am going from .NET to C ++, and I want to know if there are any good articles / information on unit testing in C ++ and the most used / best frameworks for this.

+7
c ++ unit-testing frameworks testing
source share
6 answers

I really like google test . It has all the best features of the latest unit test frameworks, while preserving everything in a minimal stream interface.

Next on my list is the Boost Test . The Google api test is a bit more modern than Boost.Test, but the Boost Test did an amazing job of adding new features and breaking the CppUnit paradigm with brutality.

I also used CxxTest . This is pretty well done, but you can say that it is not as modern as Boost.Test or Google Test. In particular, its support for test suites and gadgets is a bit inconvenient.

I like to use advanced features, but if you are minimalist, you will never see the difference between the three. Most of my colleagues would be happy with the unit test infrastructure, which supports automatic registration test (declaratively) and has a kind of macro CHECK_EQUALS(a,b) .

+12
source share

Take a look at the Boost.Test library, in particular the Unit Test Framework . This is a very powerful and easy way to get started.

+5
source share

We use UnitTest ++ , which seems adequate so far; not sure how it compares with Boost :: Test or others, though.

+1
source share

Yes, Boost.Test is good, but I also recommend UnitTest ++ , which is very easy to use.

+1
source share

Boost :: Test, but also MiniCppUnit , which I found light, very simple and easy to implement.

The article has one description of adding the addition of unit tests to his cpp application for unit ++

0
source share

I used GoogleTest and cpptest . I settled on CppTest because the intelli meaning of the IDE that I use is getting confused with GoogleTest macros. This is not their fault, but I really use the IDE function.

0
source share

All Articles