Using CppUnit

本文详细介绍了如何在Visual Studio 2005中使用CppUnit进行单元测试,包括配置RTTI、下载源代码、编译项目、设置测试类及应用实例等关键步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

The arcticle of codeproject is very clear about using CppUnit.
http://www.codeproject.com/library/Using_CPPUnit.asp

But I will speak about some important issues about the upon article:
1)If we use vs2005,RTTI setting is enalbed defaultly.We needn't to do it.
2)We can down load the source code from http://sourceforge.net/projects/cppunit
3)Compile the project in folder cppunit-1.10.2/src
4)When we compile the project successfully,we are only need of two folders named as"lib" and "include"
5)For our testing class,we need to add this line into .cpp file:
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(TestOpen,"freebird");

6)As well as,we need to add some codes into Instance member function of our application class
    CppUnit::MfcUi::TestRunner runner;
 runner.addTest(CppUnit::TestFactoryRegistry::getRegistry("freebird").makeTest());
    runner.run();

转载于:https://www.cnblogs.com/believeit/archive/2006/09/01/2183662.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值