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);
}
#define ROBOTTESTINGFRAMEWORK_ASSERT_ERROR(message)
Assertion with throwing error exception.
#define ROBOTTESTINGFRAMEWORK_TEST_CHECK(condition, message)
ROBOTTESTINGFRAMEWORK_TEST_CHECK combines ROBOTTESTINGFRAMEWORK_TEST_REPORT and ROBOTTESTINGFRAMEWORK...
#define ROBOTTESTINGFRAMEWORK_TEST_FAIL_IF_FALSE(condition, message)
Conditional failure report.
#define ROBOTTESTINGFRAMEWORK_TEST_REPORT(message)
Reporting a message to the TestResult.
class ConsoleListener listens to any messages reported by the tests during the test run,...
The base class to implememnt a test case.
The TestResultCollector class can be used to store all the events issued by the test cases,...
unsigned int failedCount()
failedCount gets the number of failed test cases.
The TestResult class is used to deliver the test results including any error and failures produced by...
void addListener(TestListener *listener)
Adding a new listener.
- 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