views:

149

answers:

6

Possible Duplicate:
Comparison of c++ unit test frameworks

Hello guys, I'm coming from .net to C++ and I want to know if there i good articles/information about unit-testing in c++ and the most used/best frameworks for doing it.

Thanks in advance.

+3  A: 

Take a look at the Boost.Test library, specifically the Unit Test Framework. It is very powerful and easy to get started.

Sam Miller
A: 

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

For an article, there's one chap's description of adding unit tests to his cpp app for unit++

gbjbaanb
+1  A: 

We're using UnitTest++ which seems adequate so far; not sure how it compares to Boost::Test or others though.

Peter
+1  A: 

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

5ound
A: 

I've used GoogleTest and cpptest. I settled on CppTest because the intelli-sense of the IDE that I'm using gets confused by GoogleTest's macros. That's not their fault, but I really do use the feature of the IDE.

Jay
+3  A: 

I really like google test. It has all of the best features of the recent unit test frameworks, while keeping it all in a minimal, stream lined interface.

Next on my list is Boost Test. Google test's api is a bit more modern than Boost.Test, but Boost Test has done an amazing job of adding new features and ditching the crufty CppUnit paradigm.

I've also used CxxTest. It's quite well done but you can tell that it's not as modern as either Boost.Test or Google Test. In particular, its support for test suites and fixtures is a bit awkward.

I like to use the advanced features, but if you're a minimalist you'll never see the difference between the three. Most of my colleagues would be happy with a unit test framework that supports auto registering test (in a declarative manner ) and has some sort of a CHECK_EQUALS(a,b) macro.

caspin