OTest2
A C++ testing framework
|
A tee reporter - a composition of several reporters. More...
#include <reportertee.h>
Public Member Functions | |
ReporterTee () | |
Ctor. More... | |
virtual | ~ReporterTee () |
Dtor. More... | |
ReporterTee (const ReporterTee &)=delete | |
ReporterTee & | operator= (const ReporterTee &)=delete |
void | appendReporter (Reporter *reporter_) |
Append a reporter. More... | |
virtual void | enterTest (const Context &context_, const std::string &name_, const Parameters ¶ms_) override |
Enter entire test. More... | |
virtual void | enterSuite (const Context &context_, const std::string &name_, const Parameters ¶ms_) override |
Enter a suite. More... | |
virtual void | enterCase (const Context &context_, const std::string &name_, const Parameters ¶ms_) override |
Enter a case. More... | |
virtual void | enterState (const Context &context_, const std::string &name_) override |
Enter a state. More... | |
virtual AssertBufferPtr | enterAssert (const Context &context_, bool condition_, const std::string &file_, int lineno_) override |
Enter an assertion. More... | |
virtual AssertBufferPtr | enterError (const Context &context_) override |
Enter an error report. More... | |
virtual void | leaveState (const Context &context_, const std::string &name_, bool result_) override |
Leave a state. More... | |
virtual void | leaveCase (const Context &context_, const std::string &name_, const Parameters ¶ms_, bool result_) override |
Leave a case. More... | |
virtual void | leaveSuite (const Context &context_, const std::string &name_, const Parameters ¶ms_, bool result_) override |
Leave a suite. More... | |
virtual void | leaveTest (const Context &context_, const std::string &name_, const Parameters ¶ms_, bool result_) override |
Leave entire test. More... | |
![]() | |
Reporter (const Reporter &)=delete | |
Reporter & | operator= (const Reporter &)=delete |
Reporter () | |
Ctor. More... | |
virtual | ~Reporter () |
Dtor. More... | |
A tee reporter - a composition of several reporters.
Definition at line 32 of file reportertee.h.
OTest2::ReporterTee::ReporterTee | ( | ) |
Ctor.
Definition at line 141 of file reportertee.cpp.
|
virtual |
Dtor.
Definition at line 145 of file reportertee.cpp.
|
delete |
void OTest2::ReporterTee::appendReporter | ( | Reporter * | reporter_ | ) |
Append a reporter.
reporter_ | The reporter. The ownership is not taken. |
Definition at line 149 of file reportertee.cpp.
|
overridevirtual |
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.
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 |
Implements OTest2::Reporter.
Definition at line 214 of file reportertee.cpp.
|
overridevirtual |
Enter a case.
context_ | the OTest2 context |
name_ | Name of the case |
params_ | Parameters of the testing object |
Implements OTest2::Reporter.
Definition at line 186 of file reportertee.cpp.
|
overridevirtual |
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.
context_ | the context |
Implements OTest2::Reporter.
Definition at line 231 of file reportertee.cpp.
|
overridevirtual |
Enter a state.
context_ | the OTest2 context |
name_ | Name of the state |
Implements OTest2::Reporter.
Definition at line 201 of file reportertee.cpp.
|
overridevirtual |
Enter a suite.
context_ | the OTest2 context |
name_ | Name of the suite |
params_ | Parameters of the testing object |
Implements OTest2::Reporter.
Definition at line 171 of file reportertee.cpp.
|
overridevirtual |
Enter entire test.
context_ | The OTest2 context |
name_ | Name of the test |
params_ | Parameters of the testing object |
Implements OTest2::Reporter.
Definition at line 156 of file reportertee.cpp.
|
overridevirtual |
Leave a case.
context_ | the OTest2 context |
name_ | Name of the case |
params_ | Parameters of the testing object |
result_ | Result of the case |
Implements OTest2::Reporter.
Definition at line 260 of file reportertee.cpp.
|
overridevirtual |
Leave a state.
context_ | the OTest2 context |
name_ | Name of the state |
result_ | Result of the state |
Implements OTest2::Reporter.
Definition at line 245 of file reportertee.cpp.
|
overridevirtual |
Leave a suite.
context_ | the OTest2 context |
name_ | Name of the suite |
params_ | Parameters of the testing object |
result_ | Result of the suite |
Implements OTest2::Reporter.
Definition at line 277 of file reportertee.cpp.
|
overridevirtual |
Leave entire test.
context_ | the OTest2 context |
name_ | Name of the leaving test |
params_ | Parameters of the testing object |
result_ | Result of the test |
Implements OTest2::Reporter.
Definition at line 294 of file reportertee.cpp.
|
delete |