OTest2
A C++ testing framework
|
A reporter creating JUnit XML reports. More...
#include <reporterjunit.h>
Classes | |
struct | Impl |
Public Member Functions | |
ReporterJUnit (const std::string &file_, bool hide_location_) | |
Ctor. More... | |
virtual | ~ReporterJUnit () |
Dtor. More... | |
ReporterJUnit (const ReporterJUnit &)=delete | |
ReporterJUnit & | operator= (const ReporterJUnit &)=delete |
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 reporter creating JUnit XML reports.
Definition at line 32 of file reporterjunit.h.
|
explicit |
Ctor.
file_ | filename of the generated XML report |
hide_location_ | If it's true the location information (file and line number is omitted in the generated XML file. |
Definition at line 285 of file reporterjunit.cpp.
|
virtual |
Dtor.
Definition at line 292 of file reporterjunit.cpp.
|
delete |
|
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 358 of file reporterjunit.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 335 of file reporterjunit.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 376 of file reporterjunit.cpp.
|
overridevirtual |
Enter a state.
context_ | the OTest2 context |
name_ | Name of the state |
Implements OTest2::Reporter.
Definition at line 352 of file reporterjunit.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 317 of file reporterjunit.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 296 of file reporterjunit.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 396 of file reporterjunit.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 389 of file reporterjunit.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 411 of file reporterjunit.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 427 of file reporterjunit.cpp.
|
delete |