The TestResult class is used to deliver the test results including any error and failures produced by tests to any listener.
More...
#include <robottestingframework/TestResult.h>
The TestResult class is used to deliver the test results including any error and failures produced by tests to any listener.
The listeneres can be added by addListener
.
Here's an example of using a TestResult:
#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, simple_suite.cpp, and simple_web.cpp.
Definition at line 43 of file TestResult.h.
◆ ListenerContainer
◆ ListenerIterator
◆ TestResult()
robottestingframework::TestResult::TestResult |
( |
| ) |
|
◆ ~TestResult()
virtual robottestingframework::TestResult::~TestResult |
( |
| ) |
|
|
virtual |
◆ addError()
void robottestingframework::TestResult::addError |
( |
const Test * |
test, |
|
|
TestMessage |
msg |
|
) |
| |
This is called when an error occurred during test run.
- Parameters
-
test | pointer to the corresponding test |
msg | correspoinding error message |
◆ addFailure()
void robottestingframework::TestResult::addFailure |
( |
const Test * |
test, |
|
|
TestMessage |
msg |
|
) |
| |
This is called when a failure occurred during test run.
- Parameters
-
test | pointer to the corresponding test |
msg | correspoinding failure message |
◆ addListener()
void robottestingframework::TestResult::addListener |
( |
TestListener * |
listener | ) |
|
◆ addReport()
void robottestingframework::TestResult::addReport |
( |
const Test * |
test, |
|
|
TestMessage |
msg |
|
) |
| |
This is called to report any arbitrary message from tests.
- Parameters
-
test | pointer to the corresponding test |
msg | correspoinding error message |
◆ endTest()
void robottestingframework::TestResult::endTest |
( |
const Test * |
test | ) |
|
This is called when a Test is finished.
- Parameters
-
test | pointer to the corresponding test |
◆ endTestRunner()
void robottestingframework::TestResult::endTestRunner |
( |
| ) |
|
◆ endTestSuite()
void robottestingframework::TestResult::endTestSuite |
( |
const Test * |
test | ) |
|
This is called when a TestSuite is finished.
- Parameters
-
test | pointer to the corresponding test |
◆ removeListener()
void robottestingframework::TestResult::removeListener |
( |
TestListener * |
listener | ) |
|
Remove a listener.
- Parameters
-
◆ reset()
void robottestingframework::TestResult::reset |
( |
| ) |
|
◆ startTest()
void robottestingframework::TestResult::startTest |
( |
const Test * |
test | ) |
|
This is called when a Test is started.
- Parameters
-
test | pointer to the corresponding test |
◆ startTestRunner()
void robottestingframework::TestResult::startTestRunner |
( |
| ) |
|
◆ startTestSuite()
void robottestingframework::TestResult::startTestSuite |
( |
const Test * |
test | ) |
|
This is called when a TestSuite is started.
- Parameters
-
test | pointer to the corresponding test |
◆ listeners
The documentation for this class was generated from the following file:
- src/robottestingframework/include/robottestingframework/TestResult.h