20 #ifndef _BASICMAINTEST_HXX_
21 #define _BASICMAINTEST_HXX_
23 #include <cppunit/CompilerOutputter.h>
24 #include <cppunit/TestResult.h>
25 #include <cppunit/TestResultCollector.h>
26 #include <cppunit/TextTestProgressListener.h>
27 #include <cppunit/BriefTestProgressListener.h>
28 #include <cppunit/extensions/TestFactoryRegistry.h>
29 #include <cppunit/TestRunner.h>
35 #if !defined WIN32 && !defined __APPLE__
36 #include <fpu_control.h>
46 int main(
int argc,
char* argv[])
48 #if !defined WIN32 && !defined __APPLE__
49 fpu_control_t cw = _FPU_DEFAULT & ~(_FPU_MASK_IM | _FPU_MASK_ZM | _FPU_MASK_OM);
53 CPPUNIT_NS::TestResult controller;
56 CPPUNIT_NS::TestResultCollector result;
57 controller.addListener( &result );
60 #if defined WIN32 || defined __APPLE__
61 CPPUNIT_NS::TextTestProgressListener progress;
63 CPPUNIT_NS::BriefTestProgressListener progress;
65 controller.addListener( &progress );
69 CPPUNIT_NS::Test *suite =
70 CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest();
74 CPPUNIT_NS::TestRunner runner;
75 runner.addTest( suite );
76 runner.run( controller);
80 std::ofstream testFile;
81 testFile.open(
"UnitTestsResult", std::ios::out | std::ios::trunc);
83 CPPUNIT_NS::CompilerOutputter outputter( &result, testFile );
88 bool wasSucessful = result.wasSuccessful();
93 return wasSucessful ? 0 : 1;