The TestRunner class runs the tests added as TestCase or TestSuite.
It simply goes through a list of the tests and run them one after each other.
Here's an example of using a TestRunner:
#include <cstdio>
class MyTest : public TestCase
{
public:
MyTest() :
TestCase("MyTest")
{
}
bool setup(int argc, char** argv) override
{
return true;
}
void tearDown() override
{
}
{
}
};
int main(int argc, char** argv)
{
ConsoleListener listener(false);
TestResultCollector collector;
TestResult result;
result.addListener(&listener);
result.addListener(&collector);
MyTest atest;
runner.addTest(&atest);
runner.run(result);
return collector.failedCount();
}
#define ROBOTTESTINGFRAMEWORK_ASSERT_ERROR(message)
Assertion with throwing error exception.
#define ROBOTTESTINGFRAMEWORK_TEST_FAIL_IF_FALSE(condition, message)
Conditional failure report.
#define ROBOTTESTINGFRAMEWORK_TEST_REPORT(message)
Reporting a message to the TestResult.
TestRunner()
TestRunner constructor.
void run(TestResult &result)
Run all the tests in the list.
Definition at line 41 of file TestRunner.h.