#include <cppunit/CompilerOutputter.h>
#include <cppunit/TestResult.h>
#include <cppunit/TestResultCollector.h>
#include <cppunit/TextTestProgressListener.h>
#include <cppunit/BriefTestProgressListener.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
#include <cppunit/TestRunner.h>
#include <stdexcept>
#include <iostream>
#include <fstream>
#include <fpu_control.h>
Go to the source code of this file.
|
int | main (int argc, char *argv[]) |
|
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Main program source for Unit Tests with cppunit package does not depend on actual tests, so we use the same for all partial unit tests.
Definition at line 46 of file BasicMainTest.hxx.
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;