Generic test reporter.
More...
#include <reporter.h>
|
| Reporter (const Reporter &)=delete |
|
Reporter & | operator= (const Reporter &)=delete |
|
| Reporter () |
| Ctor. More...
|
|
virtual | ~Reporter () |
| Dtor. More...
|
|
virtual void | enterTest (const Context &context_, const std::string &name_, const Parameters ¶ms_)=0 |
| Enter entire test. More...
|
|
virtual void | enterSuite (const Context &context_, const std::string &name_, const Parameters ¶ms_)=0 |
| Enter a suite. More...
|
|
virtual void | enterCase (const Context &context_, const std::string &name_, const Parameters ¶ms_)=0 |
| Enter a case. More...
|
|
virtual void | enterState (const Context &context_, const std::string &name_)=0 |
| Enter a state. More...
|
|
virtual AssertBufferPtr | enterAssert (const Context &context_, bool condition_, const std::string &file_, int lineno_)=0 |
| Enter an assertion. More...
|
|
virtual AssertBufferPtr | enterError (const Context &context_)=0 |
| Enter an error report. More...
|
|
virtual void | leaveState (const Context &context_, const std::string &name_, bool result_)=0 |
| Leave a state. More...
|
|
virtual void | leaveCase (const Context &context_, const std::string &name_, const Parameters ¶ms_, bool result_)=0 |
| Leave a case. More...
|
|
virtual void | leaveSuite (const Context &context_, const std::string &name_, const Parameters ¶ms_, bool result_)=0 |
| Leave a suite. More...
|
|
virtual void | leaveTest (const Context &context_, const std::string &name_, const Parameters ¶ms_, bool result_)=0 |
| Leave entire test. More...
|
|
Generic test reporter.
Definition at line 34 of file reporter.h.
◆ Reporter() [1/2]
OTest2::Reporter::Reporter |
( |
const Reporter & |
| ) |
|
|
delete |
◆ Reporter() [2/2]
OTest2::Reporter::Reporter |
( |
| ) |
|
|
default |
◆ ~Reporter()
OTest2::Reporter::~Reporter |
( |
| ) |
|
|
virtualdefault |
◆ enterAssert()
virtual AssertBufferPtr OTest2::Reporter::enterAssert |
( |
const Context & |
context_, |
|
|
bool |
condition_, |
|
|
const std::string & |
file_, |
|
|
int |
lineno_ |
|
) |
| |
|
pure virtual |
Enter an assertion.
The assertion is opened similarly to states, cases and suites until the AsssertBuffer::commitAssertion() method of the returned assertion buffer is invoked.
- Warning
- Just one assertion at time may be opened!
- Parameters
-
context_ | the OTest2 context |
condition_ | result of the assertion (false means failed assertion) |
file_ | name of the source file |
lineno_ | line number in the source file |
- Returns
- An assertion buffer object which is used for formatting the assertion report.
Implemented in OTest2::ReporterConsole, OTest2::ReporterTee, and OTest2::ReporterJUnit.
◆ enterCase()
virtual void OTest2::Reporter::enterCase |
( |
const Context & |
context_, |
|
|
const std::string & |
name_, |
|
|
const Parameters & |
params_ |
|
) |
| |
|
pure virtual |
◆ enterError()
Enter an error report.
This method is used to report errors happened in the testing framework. Errors mean failure of the test. However, they cannot be located in the user code (no filename, no line number). A good example is a not handled exception caught by the framework outside test cases.
The method works as well as the enterAssert() method with failed condition and with no location info. The opened error state is closed by the AssertBuffer::commitAssertion() method of the returned assertion buffer.
- Warning
- Just one assertion at time may be opened!
- Parameters
-
- Returns
- An assertion buffer object which is used for formatting the assertion report.
Implemented in OTest2::ReporterConsole, OTest2::ReporterTee, and OTest2::ReporterJUnit.
◆ enterState()
virtual void OTest2::Reporter::enterState |
( |
const Context & |
context_, |
|
|
const std::string & |
name_ |
|
) |
| |
|
pure virtual |
◆ enterSuite()
virtual void OTest2::Reporter::enterSuite |
( |
const Context & |
context_, |
|
|
const std::string & |
name_, |
|
|
const Parameters & |
params_ |
|
) |
| |
|
pure virtual |
◆ enterTest()
virtual void OTest2::Reporter::enterTest |
( |
const Context & |
context_, |
|
|
const std::string & |
name_, |
|
|
const Parameters & |
params_ |
|
) |
| |
|
pure virtual |
◆ leaveCase()
virtual void OTest2::Reporter::leaveCase |
( |
const Context & |
context_, |
|
|
const std::string & |
name_, |
|
|
const Parameters & |
params_, |
|
|
bool |
result_ |
|
) |
| |
|
pure virtual |
◆ leaveState()
virtual void OTest2::Reporter::leaveState |
( |
const Context & |
context_, |
|
|
const std::string & |
name_, |
|
|
bool |
result_ |
|
) |
| |
|
pure virtual |
◆ leaveSuite()
virtual void OTest2::Reporter::leaveSuite |
( |
const Context & |
context_, |
|
|
const std::string & |
name_, |
|
|
const Parameters & |
params_, |
|
|
bool |
result_ |
|
) |
| |
|
pure virtual |
◆ leaveTest()
virtual void OTest2::Reporter::leaveTest |
( |
const Context & |
context_, |
|
|
const std::string & |
name_, |
|
|
const Parameters & |
params_, |
|
|
bool |
result_ |
|
) |
| |
|
pure virtual |
◆ operator=()
The documentation for this class was generated from the following files: