ZeroErr
载入中...
搜索中...
未找到
zeroerr::IReporter类 参考abstract

IReporter is an interface that is used to report the test results. You can create a new reporter by inheriting this class and implementing the virtual functions. The following events will be called once it happens during testing. 更多...

#include <unittest.h>

类 zeroerr::IReporter 继承关系图:
zeroerr::IReporter 的协作图:

Public 成员函数

virtual ~IReporter ()=default
 
virtual std::string getName () const =0
 
virtual void testStart ()=0
 
virtual void testCaseStart (const TestCase &tc, std::stringbuf &sb)=0
 
virtual void testCaseEnd (const TestCase &tc, std::stringbuf &sb, const TestContext &ctx, int type)=0
 
virtual void subCaseStart (const TestCase &tc, std::stringbuf &sb)=0
 
virtual void subCaseEnd (const TestCase &tc, std::stringbuf &sb, const TestContext &ctx, int type)=0
 
virtual void testEnd (const TestContext &tc)=0
 
 IReporter (UnitTest &ut)
 

静态 Public 成员函数

static IReportercreate (const std::string &name, UnitTest &ut)
 Create the reporter object with the given name.
 

Protected 属性

UnitTestut
 

详细描述

IReporter is an interface that is used to report the test results. You can create a new reporter by inheriting this class and implementing the virtual functions. The following events will be called once it happens during testing.

  • testStart : called when the test starts.
  • testCaseStart : called when the test case starts.
  • testCaseEnd : called when the test case ends.
  • subCaseStart : called when the subcase starts.
  • subCaseEnd : called when the subcase ends.
  • testEnd : called when the test ends.

构造及析构函数说明

◆ ~IReporter()

virtual zeroerr::IReporter::~IReporter ( )
virtualdefault

◆ IReporter()

zeroerr::IReporter::IReporter ( UnitTest ut)
inline

成员函数说明

◆ create()

IReporter * zeroerr::IReporter::create ( const std::string &  name,
UnitTest ut 
)
static

Create the reporter object with the given name.

参数
nameThe name of the reporter. Available reporters are: console, xml.
utThe unit test object that will be used to configure the test.

◆ getName()

virtual std::string zeroerr::IReporter::getName ( ) const
pure virtual

zeroerr::ConsoleReporter , 以及 zeroerr::XmlReporter 内被实现.

◆ subCaseEnd()

virtual void zeroerr::IReporter::subCaseEnd ( const TestCase tc,
std::stringbuf &  sb,
const TestContext ctx,
int  type 
)
pure virtual

zeroerr::ConsoleReporter , 以及 zeroerr::XmlReporter 内被实现.

◆ subCaseStart()

virtual void zeroerr::IReporter::subCaseStart ( const TestCase tc,
std::stringbuf &  sb 
)
pure virtual

zeroerr::ConsoleReporter , 以及 zeroerr::XmlReporter 内被实现.

◆ testCaseEnd()

virtual void zeroerr::IReporter::testCaseEnd ( const TestCase tc,
std::stringbuf &  sb,
const TestContext ctx,
int  type 
)
pure virtual

zeroerr::ConsoleReporter 内被实现.

◆ testCaseStart()

virtual void zeroerr::IReporter::testCaseStart ( const TestCase tc,
std::stringbuf &  sb 
)
pure virtual

zeroerr::ConsoleReporter , 以及 zeroerr::XmlReporter 内被实现.

◆ testEnd()

virtual void zeroerr::IReporter::testEnd ( const TestContext tc)
pure virtual

zeroerr::ConsoleReporter , 以及 zeroerr::XmlReporter 内被实现.

◆ testStart()

virtual void zeroerr::IReporter::testStart ( )
pure virtual

zeroerr::ConsoleReporter , 以及 zeroerr::XmlReporter 内被实现.

类成员变量说明

◆ ut

UnitTest& zeroerr::IReporter::ut
protected

该类的文档由以下文件生成: