23 #ifndef _BASICMAINTEST_HXX_
24 #define _BASICMAINTEST_HXX_
26 #include <cppunit/CompilerOutputter.h>
27 #include <cppunit/TestResult.h>
28 #include <cppunit/TestResultCollector.h>
29 #include <cppunit/TextTestProgressListener.h>
30 #include <cppunit/BriefTestProgressListener.h>
31 #include <cppunit/extensions/TestFactoryRegistry.h>
32 #include <cppunit/TestRunner.h>
45 int main(
int argc,
char* argv[])
48 CPPUNIT_NS::TestResult controller;
51 CPPUNIT_NS::TestResultCollector result;
52 controller.addListener( &result );
56 CPPUNIT_NS::TextTestProgressListener progress;
58 CPPUNIT_NS::BriefTestProgressListener progress;
60 controller.addListener( &progress );
65 CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest();
69 CPPUNIT_NS::TestRunner runner;
70 runner.addTest( suite );
71 runner.run( controller);
75 std::ofstream testFile;
76 testFile.open(
"UnitTestsResult",
std::ios::out | std::ios::trunc);
78 CPPUNIT_NS::CompilerOutputter outputter( &result, testFile );
83 bool wasSucessful = result.wasSuccessful();
88 return wasSucessful ? 0 : 1;