boost.test vs. CppUnit

后端 未结 2 1329
庸人自扰
庸人自扰 2021-01-30 15:09

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 wonderi

2条回答
  •  鱼传尺愫
    2021-01-30 15:44

    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.

提交回复
热议问题