TestMain.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00028
00029
00031
00032
00033
00034 #include <cppunit/extensions/TestFactoryRegistry.h>
00035 #include <cppunit/ui/text/TestRunner.h>
00036 #include <cppunit/CompilerOutputter.h>
00037
00038
00039
00040
00041
00042 #include "../include/TestNetwork.h"
00043 #include "../include/TestThread.h"
00044 #include "../include/TestApplication.h"
00045 #include "../include/TestLogger.h"
00046 #include "../include/TestException.h"
00047 #include "../include/TestSingleton.h"
00048 #include "../include/TestPointer.h"
00049 #include "../include/TestLock.h"
00050 #include "../include/TestDummyLock.h"
00051 #include "../include/TestMutex.h"
00052 #include "../include/TestHandleClient.h"
00053 #include "../include/TestCluster.h"
00054 #include "../include/TestHost.h"
00055 #include "../include/TestName.h"
00056 #include "../include/TestDynLoad.h"
00057 #include "../include/TestBuffer.h"
00058 #include "../include/TestContext.h"
00059 #include "../include/TestNode.h"
00060 #include "../include/TestProcess.h"
00061 #include "../include/TestGLXGLContext.h"
00062 #include "../include/TestGLXRenderWindow.h"
00063 #include "../include/TestXDisplay.h"
00064 #include "../include/TestSqVM.h"
00065 #include "../include/TestOutputNode.h"
00066 #include "../include/TestContainer.h"
00067 #include "../include/TestTimer.h"
00068 #include "../include/TestHostInfo.h"
00069 #include "../include/TestOpenGLRenderingEngine.h"
00070 #include "../include/TestFileSystemManager.h"
00071 #include "../include/TestCPU.h"
00072 #include "../include/TestGPU.h"
00073 #include "../include/TestStringConverter.h"
00074 #include "../include/TestConfigOptions.h"
00075 #include "../include/TestNetServer.h"
00076 #include "../include/TestNetClient.h"
00077 #include "../include/TestClient.h"
00078 #include "../include/TestPluginManager.h"
00079 #include "../include/TestPlugin.h"
00080 #include "../include/TestRendererPlugin.h"
00081 #include "../include/TestRenderer.h"
00082 #include "../include/TestOpenGLExtensionLoader.h"
00083
00084
00085
00086 #if defined(HAVE_QT3_QAPPLICATION_H) && defined(HAVE_LIBQTTESTRUNNER)
00087 #define WITH_QTTESTRUNNER 1
00088 #endif
00089
00090 #ifdef WITH_QTTESTRUNNER
00091
00092 #undef CursorShape
00093 #undef None
00094 #undef KeyPress
00095 #undef KeyRelease
00096 #undef FocusIn
00097 #undef FocusOut
00098
00099
00100 #include <qt3/qapplication.h>
00101 #include <cppunit/ui/qt/TestRunner.h>
00102 #endif
00103
00104 using namespace ParCompMarkTest;
00105
00109 int textRunner() {
00110 CppUnit::TextUi::TestRunner runner;
00111
00112
00113 CppUnit::TestFactoryRegistry ®istry = CppUnit::TestFactoryRegistry::getRegistry();
00114
00115
00116
00117
00118 runner.addTest(registry.makeTest());
00119
00120
00121 runner.setOutputter( new CppUnit::CompilerOutputter(&runner.result(), std::cout ) );
00122
00123
00124 return runner.run() ? 0 : 1;
00125 }
00126
00130 #ifdef WITH_QTTESTRUNNER
00131 int guiRunner(int argc, char **argv) {
00132
00133
00134 QApplication app(argc, argv);
00135 CppUnit::QtTestRunner runner;
00136
00137
00138 CppUnit::TestFactoryRegistry ®istry = CppUnit::TestFactoryRegistry::getRegistry();
00139
00140
00141
00142
00143 runner.addTest(registry.makeTest());
00144
00145
00146 runner.run(true);
00147
00148 return 0;
00149 }
00150 #endif
00151
00204 int main(int argc, char **argv)
00205 {
00206 #ifdef WITH_QTTESTRUNNER
00207
00208 XInitThreads();
00209
00210 if(argc > 1 && !strcmp(argv[1], "--gui"))
00211 return guiRunner(argc, argv);
00212 else
00213 #endif
00214 return textRunner();
00215 }
00216