Thread: What is the most popular/standard C++ unit testing library/framework.

  1. #1
    Ethernal Noob
    Join Date
    Nov 2001
    Posts
    1,901

    What is the most popular/standard C++ unit testing library/framework.

    I'm used to using mbunit with C# and am going back to working with C++ and want to apply some of the TDD practices I use with C# but haven't found a industry standard Testing Library and/or framework to use. Anyone know of one such library.

  2. #2
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by indigo0086 View Post
    I'm used to using mbunit with C# and am going back to working with C++ and want to apply some of the TDD practices I use with C# but haven't found a industry standard Testing Library and/or framework to use. Anyone know of one such library.
    Boost has a unit test framework. I don't think it requires that your project itself use Boost.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  3. #3
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,412
    Quote Originally Posted by brewbuck
    Boost has a unit test framework. I don't think it requires that your project itself use Boost.
    Since it is a Boost library, to some extent it does require that projects using it use Boost, by definition

    Furthermore, it has dependencies on other Boost libraries. However, you can extract out just those parts of Boost that it depends on, but this is true of any Boost library.

    Besides Boost.Test, I have used UnitTest++, which I found easy to use.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  4. #4
    Ethernal Noob
    Join Date
    Nov 2001
    Posts
    1,901
    WHat about CppUnit

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A Question About Unit Testing
    By Tonto in forum C++ Programming
    Replies: 2
    Last Post: 12-14-2006, 08:22 PM
  2. newbie here.. pls help me in this program!
    By rothj0hn in forum C Programming
    Replies: 2
    Last Post: 02-01-2006, 10:40 PM
  3. 2-d object avoidance. Help please! (basic stuff, I think)
    By charbach007 in forum Game Programming
    Replies: 4
    Last Post: 06-15-2004, 03:49 PM
  4. Unit Actions
    By DavidP in forum Game Programming
    Replies: 20
    Last Post: 05-28-2004, 09:18 PM
  5. Unit testing tools for .NET ?
    By gicio in forum C# Programming
    Replies: 0
    Last Post: 11-10-2003, 04:43 AM