This example shows how to use a TestResultCollector to collect the result of the test run.
This example shows how to use a TestResultCollector to collect the result of the test run.
#include <cstdio>
{
public:
MyTest1() :
{
}
void run() override
{
}
};
{
public:
MyTest2() :
{
}
void run() override
{
}
};
int main(int argc, char** argv)
{
MyTest1 test1;
MyTest2 test2;
suite.addTest(&test1);
suite.addTest(&test2);
printf("\n-------- results ---------\n");
printf(
"Total number of tests : %d\n", collector.
testCount());
printf(
"Number of passed tests: %d\n", collector.
passedCount());
printf(
"Number of failed tests: %d\n", collector.
failedCount());
outputter.write("./result.txt", true);
}
#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.
unsigned int testCount()
testCount gets the number of test cases.
unsigned int passedCount()
passedCount gets the number of passed 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.
The TestRunner class runs the tests added as TestCase or TestSuite.
void run(TestResult &result)
Run all the tests in the list.
void addTest(Test *test)
Adding a new test.
The TestSuite holds a group of tests.
Class TextOutputter saves the results of the test collected by a TestResultCollector in a plain text ...