TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

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

9 点作者 quizotic超过 10 年前
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.

4 条评论

cottonseed超过 10 年前
I don&#x27;t know what special needs a startup has. I&#x27;ve used Catch and been happy with it. I haven&#x27;t used CppUnit, so I can&#x27;t compare.<p><a href="https://github.com/philsquared/Catch" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;philsquared&#x2F;Catch</a><p>Previous HN discussion (with some other suggestions):<p><a href="https://news.ycombinator.com/item?id=8220352" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=8220352</a><p>and a relevant StackOverflow thread:<p><a href="https://stackoverflow.com/questions/87794/c-unit-testing-framework" rel="nofollow">https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;87794&#x2F;c-unit-testing-fra...</a>
评论 #8855896 未加载
trcollinson超过 10 年前
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 &quot;Test Driven Development for Embedded C&quot; which I would highly recommend to anyone, even non-embedded developers.<p>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.<p>Edit: fixed typos, typing on phones is hard.
snnn超过 10 年前
What about gtest? <a href="https://code.google.com/p/googletest/" rel="nofollow">https:&#x2F;&#x2F;code.google.com&#x2F;p&#x2F;googletest&#x2F;</a>
评论 #8858812 未加载
induction超过 10 年前
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.