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
  • 39,638
  • 28
  • 112
  • 212

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
  • 98,941
  • 38
  • 226
  • 299
5

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

A few:

Community
  • 1
  • 1
Scott Saad
  • 17,962
  • 11
  • 63
  • 84
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
  • 39,067
  • 29
  • 104
  • 160
4

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

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
mfazekas
  • 5,589
  • 1
  • 34
  • 25
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
  • 16,230
  • 17
  • 74
  • 137
  • 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
  • 186
  • 1
  • 2
0

Have a look at CUnitWin32. It includes an example.

Dushara
  • 616
  • 1
  • 5
  • 25