cppunit

C++ Unit Testing Libraries [closed]

点点圈 提交于 2019-11-28 09:05:24
I've come across cppunit but it didn't look super-easy to use (maybe I didn't look hard, maybe because C++ doesn't work like Java/C#). Are there widely used, simple alternatives? In fact, is cppunit the standard unit testing framework for C++? There is no standard unit testing library for C++. There are many choices to choose from; cppunit being one of them. At my company we use Google Test along with its partner Google Mock for unit testing and object mocking. I find them both combined easier to use and much more powerful than cppunit. I've just pushed my own framework, CATCH , out there. It

何时需要单元测试以及C++单元测试工具选择

纵然是瞬间 提交于 2019-11-27 19:21:07
一、如果我们遇到下面情况,就需要单元测试(框架): 测试代码没有很好地维护而废弃,再次需要测试时还需要重写; 投入太多的精力,找 bug,而新的代码仍然会出现类似 bug; 写完代码,心里没底,是否有大量 bug 等待自己; 新修改的代码不知道是否影响其他部分代码; 由于牵扯太多,导致不敢进行修改代码; …… 二、C++单元测试工具选择 从 Java 的 JUnit 移植出 CppUnit 之后,又出现了一系列的 CppUnit 的衍生套件, 但是易用性都不太好,且有一些“顽疾”,最终都被作者遗弃了,停止了维护更新。 相对而言,出现较晚的 xUnit 衍生品 googletest 有诸多优点: 不需要再像以前那样进行麻烦的声明、定义以及注册了,一切就像调用函数那么简单; 适用诸多平台 (Linux, Mac OS X, Windows, Cygwin, Windows CE, and Symbian); 更多功能、更加可定制化; 显示信息更加丰富全面 …… 参考资料: 便利的开发工具 CppUnit 快速使用指南 ; C/C++单元测试框架的选择(CppUTest vs. CppUnit vs. CppUnitLite vs. CppTest vs. GoogleTest vs. CxxTest vs. CUnit) ; Google 开源了自己的 C++ 单元测试框架 :

便利的开发工具 CppUnit 快速使用指南【转载】

痴心易碎 提交于 2019-11-26 18:35:50
原文: http://www.ibm.com/developerworks/cn/linux/l-cppunit/index.html 背景 CppUnit 是个基于 LGPL 的开源项目,最初版本移植自 JUnit,是一个非常优秀的开源测试框架。CppUnit 和 JUnit 一样主要思想来源于极限编程(XProgramming)。主要功能就是对单元测试进行管理,并可进行自动化测试。这样描述可能没有让您体会到测试框架的强大威力,那您在开发过程中遇到下列问题吗?如果答案是肯定的,就应该学习使用这种技术: 测试代码没有很好地维护而废弃,再次需要测试时还需要重写; 投入太多的精力,找 bug,而新的代码仍然会出现类似 bug; 写完代码,心里没底,是否有大量 bug 等待自己; 新修改的代码不知道是否影响其他部分代码; 由于牵扯太多,导致不敢进行修改代码; ... 这些问题下文都会涉及。这个功能强大的测试框架在国内的 C++ 语言开发人员中使用的不是很多。本文从开发人员的角度,介绍这个框架,希望能够使开发人员用最少的代价尽快掌握这种技术。下面从基本原理,CppUnit 原理,手动使用步骤,通常使用步骤,其他实际问题等方面进行讨论。以下讨论基于 CppUnit1.8.0。 回页首 1. 基本原理 对于上面的问题仅仅说明 CppUnit 的使用是没有效果的,下面先从测试的目的

Comparison of C++ unit test frameworks [closed]

时光总嘲笑我的痴心妄想 提交于 2019-11-26 12:33:58
I know there are already a few questions regarding recommendations for C++ unit test frameworks, but all the answers did not help as they just recommend one of the frameworks but do not provide any information about a (feature) comparison. I think the most interesting frameworks are CppUnit, Boost and the new Google testing framework. Has anybody done any comparison yet? Sam Saffron See this question for some discussion. They recommend the articles: Exploring the C++ Unit Testing Framework Jungle , By Noel Llopis. And the more recent: C++ Test Unit Frameworks I have not found an article that

Comparison of C++ unit test frameworks [closed]

不羁岁月 提交于 2019-11-26 02:59:32
问题 I know there are already a few questions regarding recommendations for C++ unit test frameworks, but all the answers did not help as they just recommend one of the frameworks but do not provide any information about a (feature) comparison. I think the most interesting frameworks are CppUnit, Boost and the new Google testing framework. Has anybody done any comparison yet? 回答1: See this question for some discussion. They recommend the articles: Exploring the C++ Unit Testing Framework Jungle,