class ConsoleListener listens to any messages reported by the tests during the test run, formates them and print them to the standard output.
More...
#include <robottestingframework/ConsoleListener.h>
class ConsoleListener listens to any messages reported by the tests during the test run, formates them and print them to the standard output.
Here's an example of using a ConsoleListener:
#include <cstdio>
#include <iostream>
{
public:
MyTest() :
{
}
bool setup(int argc, char** argv) override
{
return true;
}
void tearDown() override
{
}
void run() override
{
int a = 5;
int b = 3;
}
};
int main(int argc, char** argv)
{
MyTest atest;
atest.TestCase::run(result);
}
- Examples:
- simple.cpp, simple_collector.cpp, simple_fixture.cpp, simple_runner.cpp, and simple_suite.cpp.
Definition at line 38 of file ConsoleListener.h.
◆ ConsoleListener()
robottestingframework::ConsoleListener::ConsoleListener |
( |
bool |
verbose = false | ) |
|
ConsoleListener constructor.
- Parameters
-
verbose | enables the verbose mode. If true , the source file and the line number where the messages are issued by the tests will be written to the standard output. The verbose mode is disabled by default. |
◆ ~ConsoleListener()
virtual robottestingframework::ConsoleListener::~ConsoleListener |
( |
| ) |
|
|
virtual |
◆ addError()
void robottestingframework::ConsoleListener::addError |
( |
const Test * |
test, |
|
|
TestMessage |
msg |
|
) |
| |
|
overridevirtual |
This is called when an error occurred during test run.
- Parameters
-
test | pointer to the corresponding test |
msg | correspoinding error message |
Reimplemented from robottestingframework::TestListener.
◆ addFailure()
void robottestingframework::ConsoleListener::addFailure |
( |
const Test * |
test, |
|
|
TestMessage |
msg |
|
) |
| |
|
overridevirtual |
This is called when a failure occurred during test run.
- Parameters
-
test | pointer to the corresponding test |
msg | correspoinding failure message |
Reimplemented from robottestingframework::TestListener.
◆ addReport()
void robottestingframework::ConsoleListener::addReport |
( |
const Test * |
test, |
|
|
TestMessage |
msg |
|
) |
| |
|
overridevirtual |
This is called to report any arbitrary message from tests.
- Parameters
-
test | pointer to the corresponding test |
msg | correspoinding error message |
Reimplemented from robottestingframework::TestListener.
◆ endTest()
void robottestingframework::ConsoleListener::endTest |
( |
const Test * |
test | ) |
|
|
overridevirtual |
◆ endTestRunner()
void robottestingframework::ConsoleListener::endTestRunner |
( |
| ) |
|
|
overridevirtual |
◆ endTestSuite()
void robottestingframework::ConsoleListener::endTestSuite |
( |
const Test * |
test | ) |
|
|
overridevirtual |
◆ hideUncriticalMessages()
void robottestingframework::ConsoleListener::hideUncriticalMessages |
( |
| ) |
|
hideUncriticalMessages hides the tests report messages and only shows the test assertion failure and error messages.
◆ startTest()
void robottestingframework::ConsoleListener::startTest |
( |
const Test * |
test | ) |
|
|
overridevirtual |
◆ startTestRunner()
void robottestingframework::ConsoleListener::startTestRunner |
( |
| ) |
|
|
overridevirtual |
◆ startTestSuite()
void robottestingframework::ConsoleListener::startTestSuite |
( |
const Test * |
test | ) |
|
|
overridevirtual |
◆ hideUncritical
bool robottestingframework::ConsoleListener::hideUncritical |
|
private |
◆ verbose
bool robottestingframework::ConsoleListener::verbose |
|
private |
The documentation for this class was generated from the following file: