1、下载并编译出cppunit代码
http://sourceforge.net/p/cppunit/code/HEAD/tree/
本文直接下载的是605节来编译的 cppunit-code-605-trunk.zip
2、编译
在cppunit-code-605-trunk\cppunit\ 目录下有 Build2010.sln,直接点击编译即可,solution中会有project用例报错---INSTALL-VS2010.txt
Note that the MSB3073 "build errors" reported when building the 'simple_plugin' and
'hierarchy' projects are a demonstration of failed unit tests and are not actual build
errors.
1)会生成 cppunit-code-605-trunk\cppunit\lib\里面的库文件等
2)头文件cppunit-code-605-trunk\cppunit\include\
3、工程实践
需要从上面编译的目录拷贝东东
cppunit里面包含的文件
头文件配置
库文件配置1---cppunitd.lib
库文件配置2
$(projectDir)\cppunit\lib;
测试代码如下
可以参考CPPUNIT源码工程里面的simple工程即可借鉴
本地实践结果截图效果如下