De Facto standard unit testing framework for C/C++?

Discussion in 'Programming' started by IHateMyJob2004, Dec 17, 2012.

  1. IHateMyJob2004

    Joined:
    Sep 29, 2004
    Messages:
    18,039
    Likes Received:
    27
    Is there a defacto standard unit test framework for C/C++?

    Something liek JUnit for Java?
     
  2. Crusty

    Crusty Lifer

    Joined:
    Sep 30, 2001
    Messages:
    12,688
    Likes Received:
    1
    We use the Boost test suite for all our unit testing needs at work. There's also cppunit, but I haven't used that since college.
     
  3. beyonddc

    beyonddc Senior member

    Joined:
    May 17, 2001
    Messages:
    911
    Likes Received:
    0
    Not sure if there's a de-facto standard for C/C++ but my organization used cxxtest for unit testing which is an open source unit testing framework for C++.

    Good luck
     
  4. eLiu

    eLiu Diamond Member

    Joined:
    Jun 4, 2001
    Messages:
    6,407
    Likes Received:
    1
    I've been trying to make this decision as well. Having not tried either, it looks like boost.test and googletest are the best options available right now (best in my opinion, measured by feature set & likelihood of continued future support/development). I'm leaning toward googletest but if other people at work are already using boost, then I think there's little reason to introduce more dependencies; i.e., googletest isn't substantially better.

    Both of these are kinda heavy in the footprint department so if you want something really lightweight, I think there are things like cutest for C++.

    You can search around for some well-informed comparisons of various C++ testing frameworks. Wikipedia is a decent starting place in terms of just listing out which frameworks have what [commonly] desired options. I'll say that the direct analogues of things like junit are *not* what you want in C++; those frameworks are pain.
     
  5. cytg111

    cytg111 Diamond Member

    Joined:
    Mar 17, 2008
    Messages:
    4,036
    Likes Received:
    541
    also, while not putting anand's programming section down, you'd get alot more attention, experience and numbers at places like stackoverflow and codeproject.
     
  6. Markbnj

    Markbnj Elite Member <br>Moderator Emeritus
    Moderator

    Joined:
    Sep 16, 2005
    Messages:
    15,688
    Likes Received:
    11
    I'll give you attention and numbers. Experience? Not so much.
     
  7. veri745

    veri745 Golden Member

    Joined:
    Oct 11, 2007
    Messages:
    1,158
    Likes Received:
    4
    I use Google Test and Google Mock at work and like it a lot. It works pretty slick.