Using CppUnit

长平狐 发布于 2012/08/28 16:37
阅读 192
收藏 0

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();


原文链接:http://blog.csdn.net/sheismylife/article/details/1154933
加载中
返回顶部
顶部