Jump to content
  • Advertisement
Sign in to follow this  
MrMark

C++ testing frameworks

This topic is 3551 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!