X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=src%2Ftest%2Fmain.cpp;fp=src%2Ftest%2Fmain.cpp;h=4eca9d027c98d4cffb419e736d30a34a8167b0f6;hb=7ec029d28e715c3c8826b1aea0b1a3afe53de603;hp=0000000000000000000000000000000000000000;hpb=bef4a9fc121deae7ba81687eee1c73fe61e5ca33;p=germs.git diff --git a/src/test/main.cpp b/src/test/main.cpp new file mode 100644 index 0000000..4eca9d0 --- /dev/null +++ b/src/test/main.cpp @@ -0,0 +1,34 @@ +#include +#include +#include +#include +#include +#include + + +int +main( int argc, char* argv[] ) +{ + // Create the event manager and test controller + CPPUNIT_NS::TestResult controller; + + // Add a listener that colllects test result + CPPUNIT_NS::TestResultCollector result; + controller.addListener( &result ); + + // Add a listener that print dots as test run. + CPPUNIT_NS::BriefTestProgressListener progress; + controller.addListener( &progress ); + + // Add the top suite to the test runner + CPPUNIT_NS::TestRunner runner; + runner.addTest( CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest() ); + runner.run( controller ); + + // Print test in a compiler compatible format. + CPPUNIT_NS::CompilerOutputter outputter( &result, CPPUNIT_NS::stdCOut() ); + outputter.write(); + + return result.wasSuccessful() ? 0 : 1; +} +