

Ask HN: What is a good C++ unit test framework for a startup? - quizotic

Don&#x27;t have a ton of code or test cases yet - just three months into a startup with four developers.<p>Looking for something relatively lightweight, with a small learning curve, that can keep us honest for the next year or two.  I&#x27;ve used CppUnit in the past.  Didn&#x27;t hate it.  Wondering if there&#x27;s something better.<p>Do you have opinions on this?  Looking for your war stories, whether good, bad, or plain ugly.
======
cottonseed
I 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-
fra...](https://stackoverflow.com/questions/87794/c-unit-testing-framework)

~~~
bowlofstew
+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)

------
trcollinson
I 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.

------
snnn
What about gtest?
[https://code.google.com/p/googletest/](https://code.google.com/p/googletest/)

~~~
sondring
+1 for gtest, with google mock along side it.

------
induction
I 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.

