I use the following code to run CppUnit tests:
CppUnit::TextTestRunner runner;
CppUnit::TestFactoryRegistry ®istry = CppUnit::TestFactoryRegistry::getRegistry();
runner.addTest(registry.makeTest());
bool result = !SehSafeTestExecutorCPPUnit::Execute(runner);
return result;
It prints dots and 'F' but the details on each error are printed afterwards. Is it possible to print details on fails immediately like it's done in gtest?
You can derive a custom class from
TestListener, and implement your custom reporting inendTest(). Don't forget you have to add your customTestListenerto yourTestResult.If you're only interested in the instant reporting of failures, you can create a custom
TestResultCollectorand overloadaddFailure()with a call to your own output (don't forget to call the parentaddFailure().)