Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

boost.test vs. CppUnit

I've been using CppUnit for quite a while now (and am happy with it). As we are using more and more parts of the boost library I had a short look on boost.test and I'm wondering now if I should switch to boost.test in a new project or not.

Can anyone here tell me about the differences between the two frameworks and the benefits (if there are any) of using boost.test?

like image 206
chrmue Avatar asked Jun 23 '10 09:06

chrmue


1 Answers

How is this less clunky than Boost.Test alternative:

class MyFixture { MyFixture() { /* setup here */} };

BOOST_AUTO_TEST_CASE( my_test, MyFixture )
{
    BOOST_CHECK_EQUAL(0, foo);
}

Macros indeed a bit longer, but this is safer and is recommended practice in C++.

I am yet to see a single technical reason to prefer Google Test (and I know quite a few to prefer Boost.Test). The rest is just your preference.

like image 149
Gennadiy Rozental Avatar answered Oct 16 '22 13:10

Gennadiy Rozental