FreeNOS
Public Member Functions | Protected Member Functions | Protected Attributes
TestReporter Class Referenceabstract

Responsible for outputting test results. More...

#include <TestReporter.h>

Inheritance diagram for TestReporter:
StdoutReporter TAPReporter XMLReporter

Public Member Functions

 TestReporter (int argc, char **argv)
 Constructor. More...
 
virtual ~TestReporter ()
 Destructor. More...
 
uint getOk () const
 Get OK count. More...
 
uint getFailed () const
 Get fail count. More...
 
uint getSkipped () const
 Get skip count. More...
 
void setReport (bool value)
 Set reporting on/off. More...
 
void setStatistics (bool value)
 Set final statistics on/off. More...
 
void setMultiline (bool value)
 Set multine mode on/off. More...
 
virtual void prepare (TestInstance &test)
 Prepare for next test. More...
 
virtual void collect (TestInstance &test, TestResult &result)
 Collect test statistics. More...
 
virtual void begin (List< TestInstance * > &tests)
 Begin testing. More...
 
virtual void finish (List< TestInstance * > &tests)
 Finish testing. More...
 

Protected Member Functions

virtual void reportBegin (List< TestInstance * > &tests)=0
 Report start of testing. More...
 
virtual void reportBefore (TestInstance &test)=0
 Report start of a test. More...
 
virtual void reportAfter (TestInstance &test, TestResult &result)=0
 Report finish of a test. More...
 
virtual void reportFinish (List< TestInstance * > &tests)=0
 Report completion of all tests. More...
 

Protected Attributes

int m_argc
 Argument count. More...
 
char ** m_argv
 Argument values. More...
 
bool m_report
 Report on/off. More...
 
bool m_statistics
 Final statistics on/off. More...
 
bool m_multiline
 Multi line output. More...
 
uint m_ok
 Test statistics. More...
 
uint m_fail
 
uint m_skip
 

Detailed Description

Responsible for outputting test results.

Definition at line 35 of file TestReporter.h.

Constructor & Destructor Documentation

◆ TestReporter()

TestReporter::TestReporter ( int  argc,
char **  argv 
)

Constructor.

Definition at line 21 of file TestReporter.cpp.

References m_argc, m_argv, m_fail, m_multiline, m_ok, m_report, m_skip, and m_statistics.

◆ ~TestReporter()

TestReporter::~TestReporter ( )
virtual

Destructor.

Definition at line 33 of file TestReporter.cpp.

Member Function Documentation

◆ begin()

void TestReporter::begin ( List< TestInstance * > &  tests)
virtual

Begin testing.

Definition at line 88 of file TestReporter.cpp.

References m_report, and reportBegin().

Referenced by TestRunner::run().

◆ collect()

void TestReporter::collect ( TestInstance test,
TestResult result 
)
virtual

Collect test statistics.

Definition at line 73 of file TestReporter.cpp.

References TestResult::isFailed(), TestResult::isOK(), TestResult::isSkipped(), m_fail, m_ok, m_report, m_skip, and reportAfter().

Referenced by TestRunner::run().

◆ finish()

void TestReporter::finish ( List< TestInstance * > &  tests)
virtual

Finish testing.

Definition at line 94 of file TestReporter.cpp.

References m_statistics, and reportFinish().

Referenced by TestRunner::run().

◆ getFailed()

uint TestReporter::getFailed ( ) const

Get fail count.

Definition at line 42 of file TestReporter.cpp.

References m_fail.

Referenced by TestRunner::run().

◆ getOk()

uint TestReporter::getOk ( ) const

Get OK count.

Definition at line 37 of file TestReporter.cpp.

References m_ok.

◆ getSkipped()

uint TestReporter::getSkipped ( ) const

Get skip count.

Definition at line 47 of file TestReporter.cpp.

References m_skip.

◆ prepare()

void TestReporter::prepare ( TestInstance test)
virtual

Prepare for next test.

Definition at line 67 of file TestReporter.cpp.

References m_report, and reportBefore().

Referenced by TestRunner::run().

◆ reportAfter()

virtual void TestReporter::reportAfter ( TestInstance test,
TestResult result 
)
protectedpure virtual

Report finish of a test.

Implemented in XMLReporter, TAPReporter, and StdoutReporter.

Referenced by collect().

◆ reportBefore()

virtual void TestReporter::reportBefore ( TestInstance test)
protectedpure virtual

Report start of a test.

Implemented in XMLReporter, TAPReporter, and StdoutReporter.

Referenced by prepare().

◆ reportBegin()

virtual void TestReporter::reportBegin ( List< TestInstance * > &  tests)
protectedpure virtual

Report start of testing.

Implemented in XMLReporter, TAPReporter, and StdoutReporter.

Referenced by begin().

◆ reportFinish()

virtual void TestReporter::reportFinish ( List< TestInstance * > &  tests)
protectedpure virtual

Report completion of all tests.

Implemented in XMLReporter, TAPReporter, and StdoutReporter.

Referenced by finish().

◆ setMultiline()

void TestReporter::setMultiline ( bool  value)

Set multine mode on/off.

Definition at line 62 of file TestReporter.cpp.

References m_multiline.

◆ setReport()

void TestReporter::setReport ( bool  value)

Set reporting on/off.

Definition at line 52 of file TestReporter.cpp.

References m_report.

◆ setStatistics()

void TestReporter::setStatistics ( bool  value)

Set final statistics on/off.

Definition at line 57 of file TestReporter.cpp.

References m_statistics.

Referenced by TestRunner::TestRunner().

Field Documentation

◆ m_argc

int TestReporter::m_argc
protected

Argument count.

Definition at line 124 of file TestReporter.h.

Referenced by TestReporter().

◆ m_argv

char** TestReporter::m_argv
protected

◆ m_fail

uint TestReporter::m_fail
protected

◆ m_multiline

bool TestReporter::m_multiline
protected

◆ m_ok

uint TestReporter::m_ok
protected

◆ m_report

bool TestReporter::m_report
protected

Report on/off.

Definition at line 130 of file TestReporter.h.

Referenced by begin(), collect(), prepare(), setReport(), and TestReporter().

◆ m_skip

uint TestReporter::m_skip
protected

◆ m_statistics

bool TestReporter::m_statistics
protected

Final statistics on/off.

Definition at line 133 of file TestReporter.h.

Referenced by finish(), setStatistics(), and TestReporter().


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