]> ruin.nu Git - germs.git/blob - test/main.cpp
some initial tests
[germs.git] / test / main.cpp
1 #include <cppunit/BriefTestProgressListener.h>
2 #include <cppunit/CompilerOutputter.h>
3 #include <cppunit/extensions/TestFactoryRegistry.h>
4 #include <cppunit/TestResult.h>
5 #include <cppunit/TestResultCollector.h>
6 #include <cppunit/TestRunner.h>
7
8
9 int
10 main( int argc, char* argv[] )
11 {
12   // Create the event manager and test controller
13   CPPUNIT_NS::TestResult controller;
14
15   // Add a listener that colllects test result
16   CPPUNIT_NS::TestResultCollector result;
17   controller.addListener( &result );        
18
19   // Add a listener that print dots as test run.
20   CPPUNIT_NS::BriefTestProgressListener progress;
21   controller.addListener( &progress );      
22
23   // Add the top suite to the test runner
24   CPPUNIT_NS::TestRunner runner;
25   runner.addTest( CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest() );
26   runner.run( controller );
27
28   // Print test in a compiler compatible format.
29   CPPUNIT_NS::CompilerOutputter outputter( &result, CPPUNIT_NS::stdCOut() );
30   outputter.write(); 
31
32   return result.wasSuccessful() ? 0 : 1;
33 }
34