4

I'm looking for a "quick and dirty" C++ testing framework I can use on my Windows/Visual Studio box. It's just me developing, so it doesn't have to be enterprise class software. Staring at a list of testing frameworks, I am somewhat befuddled...

http://en.wikipedia.org/wiki/List_of_unit_testing_frameworks#C.2B.2B

Paul Nathan
  • 38,780
  • 28
  • 111
  • 207

7 Answers7

5

I have used both UnitTest++ and Boost.Test. They are both easy to setup and use. Although, I wouldn't use Boost.Test if you're not already using the Boost libraries. It's a bit much to install all of Boost just to get the testing framework.

Ferruccio
  • 96,346
  • 38
  • 221
  • 297
5

Great question! There have already been a few questions that address

A few:

Community
  • 1
  • 1
Scott Saad
  • 17,418
  • 10
  • 61
  • 83
5

Here's a great article about C++ TDD frameworks. For the record, my personal preference is CxxTest, which I have been happily using for about six months now.

Nik Reiman
  • 37,525
  • 27
  • 102
  • 159
4

Also take a look at Google Test, Google's C++ test framework.

Vadim Kotov
  • 7,766
  • 8
  • 46
  • 61
mfazekas
  • 5,390
  • 1
  • 32
  • 24
1

I use UnitTest++ and AMOP for the Mock objects.

However now I would take a long hard look at GoogleTest and GoogleMock as they would probably complement each other quite well.

graham.reeds
  • 15,795
  • 16
  • 68
  • 133
  • I was using UnitTest++ and hippomocks, and I took a look at GoogleTest and GoogleMock, and I can say that my current tools are a lot simpler. – Vincent Dec 12 '12 at 16:07
  • Is that due to them being related? I have used UnitTest++ (and still do on older projects) and can't imagine anything being simpler than UT++. Is HippoMocks difficult? – graham.reeds Dec 13 '12 at 08:57
  • No they aren't related. They are both really simple to use. – Vincent Dec 17 '12 at 22:19
0

To get a bare bones testing suite going, I recommend the include-only "Fructose". It is especially neat if you want your tests to run on platforms where text output requires calling non-standard APIs (think gaming consoles, embedded devices etc.)

Rune Braathen
  • 176
  • 1
  • 2
0

Have a look at CUnitWin32. It includes an example.

Dushara
  • 636
  • 1
  • 5
  • 25