ZeroErr
zeroerr::IReporter Class Referenceabstract

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. More...

#include <unittest.h>

Inheritance diagram for zeroerr::IReporter:
Collaboration diagram for zeroerr::IReporter:

Public Member Functions

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)
 

Static Public Member Functions

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

Protected Attributes

UnitTestut
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ~IReporter()

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

◆ IReporter()

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

Member Function Documentation

◆ create()

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

Create the reporter object with the given name.

Parameters
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

◆ subCaseEnd()

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

◆ subCaseStart()

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

◆ testCaseEnd()

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

◆ testCaseStart()

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

◆ testEnd()

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

◆ testStart()

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

Member Data Documentation

◆ ut

UnitTest& zeroerr::IReporter::ut
protected

The documentation for this class was generated from the following files: