C++ testing frameworks

Started by
17 comments, last by Sneftel 15 years, 5 months ago
What are some good C++ testing frameworks ? My biggest problem in my last major C++ project was finding exactly where bugs were coming from, and not breaking old code when I introduce new features. This time around I want to be a lot more methodical and a proper testing framework is a good start I think.
Advertisement
Obligitory link 1 and two.

Personally I took CppUnitLite and heavily modified it so it was suitable for my purposes. It's working out really well since I get to tune it exactly for my needs, but if you've not got the time then check out the above links and see which features you find most important.
I've been using Boost.Test for a while now, and that works really well too.
test-o-matic! Disclaimer: I made it. See the wiki for more information.
I'm using Cpp Unit. Working really well.
Google has one. I think it's fairly new. I've never used it but it looks pretty nice.

On my current project I just rolled my own. I don't think it's that crazy to roll your own, since it doesn't take that much code, and you might want to adapt your testing strategy to the needs of your project.
Quote:Original post by OrangyTang
Personally I took CppUnitLite and heavily modified it so it was suitable for my purposes. It's working out really well since I get to tune it exactly for my needs, but if you've not got the time then check out the above links and see which features you find most important.
Same here, though I found the modifications needed to be pretty minor. CppUnit is nice but a little heavy to apply, and Boost.Test... my goodness. I'm pretty sure unit tests aren't meant to be that painful.
I've been using UnitTest++ recently.
Quote:Original post by SneftelBoost.Test... my goodness. I'm pretty sure unit tests aren't meant to be that painful.


Heh, how do you mean? I haven't yet used it on any large projects, but so far, it's been surprisingly easy to use. Am I just missing something major here? [grin]
Quote:Original post by Spoonbender
Heh, how do you mean? I haven't yet used it on any large projects, but so far, it's been surprisingly easy to use. Am I just missing something major here? [grin]
Perhaps it's just a matter of personal preference. At a minimum, I feel a testing framework should free you from having to do accounting for your own tests. I'd like to write a class, and write tests for it inline, easily and without any repetition or extra boilerplate or files. That's the only difficult part of writing such a framework, after all... the rest pretty much comes down to a big AND clause. Boost.Test makes me put each unit test in a separate class, written out in longhand, manually added to a test suite. I consider that to be too much work. Surely the organization that came up with Boost.Spirit and Boost.Lambda can use a few Stupid C++ Tricks to make that stuff more streamlined?

This topic is closed to new replies.

Advertisement