5 ms·
Ask HN: What is a good C++ unit test framework for a startup?
Don't have a ton of code or test cases yet - just three months into a startup with four developers.
Looking for something relatively lightweight, with a small learning curve, that can keep us honest for the next year or two. I've used CppUnit in the past. Didn't hate it. Wondering if there's something better.
Do you have opinions on this? Looking for your war stories, whether good, bad, or plain ugly.
- trcollinson 12y agoI really enjoy CppUTest. It was written by James Grenning who is one brilliant engineer if you ask me. He also wrote the fantastic book "Test Driven Development for Embedded C" which I would highly recommend to anyone, even non-embedded developers. I used CppUTest on a c++ project to test algorithms for image and video manipulation. It worked fantastically, very easy to learn, and it helped test drive and optimize the algorithms. Highly recommended. Edit: fixed typos, typing on phones is hard.
- cottonseed 12y agoI don't know what special needs a startup has. I've used Catch and been happy with it. I haven't used CppUnit, so I can't compare. https://github.com/philsquared/Catch https://github.com/philsquared/Catch Previous HN discussion (with some other suggestions): https://news.ycombinator.com/item?id=8220352 https://news.ycombinator.com/item?id=8220352 and a relevant StackOverflow thread: https://stackoverflow.com/questions/87794/c-unit-testing-framework https://stackoverflow.com/questions/87794/c-unit-testing-fra...
- bowlofstew 12y ago+1 catch. There is also lest: https://github.com/martinmoene/lest https://github.com/martinmoene/lest bandit: https://github.com/joakimkarlsson/bandit https://github.com/joakimkarlsson/bandit cpputest: https://github.com/cpputest/cpputest https://github.com/cpputest/cpputest
- snnn 12y agoWhat about gtest? https://code.google.com/p/googletest/ https://code.google.com/p/googletest/
- sondring 12y ago+1 for gtest, with google mock along side it.
- induction 12y agoI am a heavy user of gtest. I like to integrate it with CMake and CTest, then use ctest --verbose in the build and release process, with lib_gtest.a linked against test commands specified for CTest.