阳光VIP

少壮不努力,老大徒伤悲。平日弗用功,自到临期悔。
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

Using CppUnit

Posted on 2012-02-03 12:04  阳光VIP  阅读(140)  评论(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();