资源简介
鼎鼎大名的XUnit系列C++方面产品库.
开源的单元测试框架. 算半自动化吧. 只是提供了一个框架.
没听过CPPUnit? JUnit听过吧? 还是没听过? 那我怀疑你根本不知道什么是单元测试.

代码片段和文件信息
// //////////////////////////////////////////////////////////////////////////
// Implementation file ClockerListener.cpp for class ClockerListener
// (c)Copyright 2000 Baptiste Lepilleur.
// Created: 2002/04/19
// //////////////////////////////////////////////////////////////////////////
#include
#include
#include “ClockerListener.h“
#include “ClockerModel.h“
#include
ClockerListener::ClockerListener( ClockerModel *model
bool text )
: m_model( model )
m_text( text )
{
}
ClockerListener::~ClockerListener()
{
}
void
ClockerListener::startTestRun( CPPUNIT_NS::Test *test
CPPUNIT_NS::TestResult *eventManager )
{
m_model->setExpectedTestCount( test->countTestCases() *2 );
}
void
ClockerListener::endTestRun( CPPUNIT_NS::Test *test
CPPUNIT_NS::TestResult *eventManager )
{
if ( m_text )
printStatistics();
}
void
ClockerListener::startTest( CPPUNIT_NS::Test *test )
{
m_model->enterTest( test false );
}
void
ClockerListener::endTest( CPPUNIT_NS::Test *test )
{
m_model->exitTest( test false );
}
void
ClockerListener::startSuite( CPPUNIT_NS::Test *suite )
{
m_model->enterTest( suite true );
}
void
ClockerListener::endSuite( CPPUNIT_NS::Test *suite )
{
m_model->exitTest( suite true );
}
void
ClockerListener::printStatistics() const
{
printTest( 0 ““ );
CPPUNIT_NS::stdCOut() << “\n“;
CPPUNIT_NS::stdCOut() << “Total elapsed time: “;
printTime( m_model->totalElapsedTime() );
CPPUNIT_NS::stdCOut() << “ average test case time: “;
printTime( m_model->averageTestCaseTime() );
}
void
ClockerListener::printTest( int testIndex
const std::string &indentString ) const
{
std::string indent = indentString;
const int indentLength = 3;
printTestIndent( indentString indentLength );
printTime( m_model->testTimeFor( testIndex ) );
CPPUNIT_NS::stdCOut() << m_model->testPathFor( testIndex ).getChildTest()->getName();
CPPUNIT_NS::stdCOut() << “\n“;
if ( m_model->childCountFor( testIndex ) == 0 )
indent+= std::string( indentLength ‘ ‘ );
else
indent+= “|“ + std::string( indentLength -1 ‘ ‘ );
for ( int index =0; index < m_model->childCountFor( testIndex ); ++index )
printTest( m_model->childAtFor( testIndex index ) indent );
}
void
ClockerListener::printTestIndent( const std::string &indent
const int indentLength ) const
{
if ( indent.empty() )
return;
CPPUNIT_NS::stdCOut() << “ “;
CPPUNIT_NS::stdCOut() << indent.substr( 0 indent.length() - indentLength ) ;
CPPUNIT_NS::stdCOut() << “+“ << std::string( indentLength -1 ‘-‘ );
}
void
ClockerListener::printTime( double time ) const
{
CPPUNIT_NS::stdCOut() << ‘(‘ << ClockerModel::timeStringFor( time ) << “s) “;
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 271151 2008-02-20 13:59 cppunit-1.12.1\aclocal.m4
文件 286 2002-09-23 13:43 cppunit-1.12.1\AUTHORS
文件 129 2003-06-05 14:18 cppunit-1.12.1\BUGS
文件 134056 2008-02-07 16:46 cppunit-1.12.1\ChangeLog
文件 2249 2002-09-17 02:35 cppunit-1.12.1\CodingGuideLines.txt
文件 5056 2001-06-17 23:47 cppunit-1.12.1\config\ac_create_prefix_config_h.m4
文件 739 2001-07-08 00:05 cppunit-1.12.1\config\ac_cxx_have_sstream.m4
文件 837 2001-09-20 12:18 cppunit-1.12.1\config\ac_cxx_have_strstream.m4
文件 717 2001-06-03 07:26 cppunit-1.12.1\config\ac_cxx_namespaces.m4
文件 998 2001-06-03 06:29 cppunit-1.12.1\config\ac_cxx_rtti.m4
文件 907 2001-06-03 07:26 cppunit-1.12.1\config\ac_cxx_string_compare_string_first.m4
文件 1253 2003-05-08 04:07 cppunit-1.12.1\config\ac_dll.m4
文件 1117 2004-02-19 04:45 cppunit-1.12.1\config\ax_cxx_gcc_abi_demangle.m4
文件 731 2007-01-27 12:19 cppunit-1.12.1\config\ax_cxx_have_isfinite.m4
文件 1274 2007-01-12 12:24 cppunit-1.12.1\config\bb_enable_doxygen.m4
文件 44892 2008-02-18 04:10 cppunit-1.12.1\config\config.guess
文件 2621 2008-02-20 14:04 cppunit-1.12.1\config\config.h.in
文件 33387 2008-02-18 04:10 cppunit-1.12.1\config\config.sub
文件 17867 2008-02-10 10:55 cppunit-1.12.1\config\depcomp
文件 13620 2008-02-10 10:55 cppunit-1.12.1\config\install-sh
文件 199984 2008-02-02 21:28 cppunit-1.12.1\config\ltmain.sh
文件 11135 2008-02-10 10:55 cppunit-1.12.1\config\missing
文件 750156 2008-02-20 13:59 cppunit-1.12.1\configure
文件 4307 2008-02-20 13:59 cppunit-1.12.1\configure.in
文件 4359 2002-04-21 20:32 cppunit-1.12.1\contrib\bc5\bcc-makefile.zip
文件 5147 2008-02-20 14:04 cppunit-1.12.1\contrib\msvc\AddingUnitTestMethod.dsm
文件 11405 2008-02-20 14:04 cppunit-1.12.1\contrib\msvc\CppUnit.WWTpl
文件 462 2008-02-20 14:04 cppunit-1.12.1\contrib\msvc\readme.txt
文件 3925 2006-03-05 04:58 cppunit-1.12.1\contrib\xm
文件 1960 2002-04-18 17:58 cppunit-1.12.1\contrib\xm
............此处省略1079个文件信息
相关资源
- 移木块游戏,可以自编自玩,vc6.0编写
- MFC数字钟(基于VC6.0)
- 安科瑞智能电能表MODBUS通讯程序 VC6
- VC6LineNumberAddin.dll
- 用VC6.0实现多边形扫描线填充算法
- VC助手 VC6.0助手
- VC6 USB开发源码
- IEC104开源库
- 吕鑫vc6c++数据结构视频源码
- MFC的异步网络通讯应用程序
- VC6查找与替换插件
- 经典开源A星算法含完整运行程序
- 可解码所有jpeg格式图片的开源JPEG解码
- UC/OS2 (UCOS2)移植于VC6代码及手册
- VC6.0 完整的图像处理程序 运用了大量
- 汉字转拼音 自适应多音字处理 姓名自
- 虹膜识别开源代码OSIRIS4.1基于opencv
- VC6.0经典串口通信源程序C++
- VC6.0MFC界面美化
- 即时通讯开发源码终极版C#.NETC++都有
- DNFC++辅助开源
- win7风格的mfc界面美化源代码
- VS打开VC6.0所需libcd.lib
- MFC画圆自定义|位置|半径|边界和内部
- 用vc++6.0实现的银行账户管理系统
- vc6.0编程助手Visual_AssistX(含破解补丁
- VC6.0_MFC画图demo小程序源码
- Visual_assist_X_for_VC6.0破解版.rar
- C++&easyx;的坦克大战
- VC开发MFC局域网屏幕监控系统完美版
评论
共有 条评论