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;
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);
}