This example shows how to use a TestRunner to run the tests.
#include <cstdio>
class MyTest : public TestCase
{
public:
MyTest() :
TestCase("MyTest")
{
}
bool setup(int argc, char** argv) override
{
return true;
}
void tearDown() override
{
}
void run() override
{
}
};
int main(int argc, char** argv)
{
ConsoleListener listener(false);
TestResultCollector collector;
TestResult result;
result.addListener(&listener);
result.addListener(&collector);
TestRunner runner;
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.