2
#include <cppunit/CompilerOutputter.h>
3
#include <cppunit/extensions/TestFactoryRegistry.h>
4
#include <cppunit/ui/text/TestRunner.h>
7
int main(int argc, char* argv[])
9
// Get the top level suite from the registry
10
CPPUNIT_NS::Test *suite = CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest();
12
// Adds the test to the list of test to run
13
CPPUNIT_NS::TextUi::TestRunner runner;
14
runner.addTest( suite );
16
// Change the default outputter to a compiler error format outputter
17
runner.setOutputter( new CPPUNIT_NS::CompilerOutputter( &runner.result(),
20
bool wasSucessful = runner.run();
22
// Return error code 1 if the one of test failed.
23
return wasSucessful ? 0 : 1;