summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorBaptiste Lepilleur <gaiacrtn@free.fr>2005-12-12 06:40:09 +0000
committerBaptiste Lepilleur <gaiacrtn@free.fr>2005-12-12 06:40:09 +0000
commit9d4a769ee6f24f0102c788112b0223fe1531a0c8 (patch)
tree17986beee882727d2c319bceefea865387d87a99 /examples
parent14f75b034e693de1aee91a8d3de050dc2a7b7c95 (diff)
downloadcppunit-9d4a769ee6f24f0102c788112b0223fe1531a0c8.tar.gz
Integrated Ernst patch for QtTestRunner and Qt 3.
integrated Ernst patch for QtTestRunner and Qt 3.x. * upgrade QtTestRunner to Qt 3.x * enhanced qmake project files to handle multiple build configuration
Diffstat (limited to 'examples')
-rw-r--r--examples/qt/Example.pro11
-rw-r--r--examples/qt/ExampleTestCases.cpp (renamed from examples/qt/ExampleTestCase.cpp)9
-rw-r--r--examples/qt/ExampleTestCases.h (renamed from examples/qt/ExampleTestCase.h)1
-rwxr-xr-xexamples/qt/build.bat3
-rw-r--r--examples/qt/qt_example.pro73
-rwxr-xr-xexamples/qt/run.bat2
6 files changed, 76 insertions, 23 deletions
diff --git a/examples/qt/Example.pro b/examples/qt/Example.pro
deleted file mode 100644
index c23a1e8..0000000
--- a/examples/qt/Example.pro
+++ /dev/null
@@ -1,11 +0,0 @@
-TEMPLATE = app
-CONFIG = qt warn_on release thread
-win32-msvc:INCLUDEPATH = ../../include
-win32-msvc:LIBS = ../../lib/cppunit.lib ../../lib/qttestrunner.lib
-win32-msvc:TMAKE_CXXFLAGS = /GX /GR
-win32-msvc:DEFINES = QT_DLL QTTESTRUNNER_DLL
-HEADERS = ExampleTestCase.h
-SOURCES = ExampleTestCase.cpp \
- Main.cpp
-INTERFACES =
-TARGET = example \ No newline at end of file
diff --git a/examples/qt/ExampleTestCase.cpp b/examples/qt/ExampleTestCases.cpp
index db0195e..eddff6e 100644
--- a/examples/qt/ExampleTestCase.cpp
+++ b/examples/qt/ExampleTestCases.cpp
@@ -1,4 +1,4 @@
-#include "ExampleTestCase.h"
+#include "ExampleTestCases.h"
CPPUNIT_TEST_SUITE_REGISTRATION( ExampleTestCase );
@@ -28,13 +28,6 @@ void ExampleTestCase::testAdd ()
}
-void ExampleTestCase::testDivideByZero ()
-{
- int zero = 0;
- int result = 8 / zero;
-}
-
-
void ExampleTestCase::testEquals ()
{
std::auto_ptr<long> l1 (new long (12));
diff --git a/examples/qt/ExampleTestCase.h b/examples/qt/ExampleTestCases.h
index cba472c..af2637f 100644
--- a/examples/qt/ExampleTestCase.h
+++ b/examples/qt/ExampleTestCases.h
@@ -16,7 +16,6 @@ class ExampleTestCase : public CPPUNIT_NS::TestFixture
CPPUNIT_TEST( example );
CPPUNIT_TEST( anotherExample );
CPPUNIT_TEST( testAdd );
- CPPUNIT_TEST( testDivideByZero );
CPPUNIT_TEST( testEquals );
CPPUNIT_TEST_SUITE_END();
protected:
diff --git a/examples/qt/build.bat b/examples/qt/build.bat
index 5c3d7c6..c89fd89 100755
--- a/examples/qt/build.bat
+++ b/examples/qt/build.bat
@@ -1,3 +1,2 @@
-tmake Example.pro -o Makefile
-nmake clean
+qmake qt_example.pro
nmake
diff --git a/examples/qt/qt_example.pro b/examples/qt/qt_example.pro
new file mode 100644
index 0000000..2de67df
--- /dev/null
+++ b/examples/qt/qt_example.pro
@@ -0,0 +1,73 @@
+#----------------------------------------------------------------------
+# File: qt_example.pro
+# Purpose: qmake config file for the QtTestRunner example.
+# The program is built with the QtTestRunner debug staticlib.
+# Set the CONFIG variable accordingly to build it differently.
+#----------------------------------------------------------------------
+
+TEMPLATE = app
+LANGUAGE = C++
+TARGET = qt_example
+
+# Get rid of possibly predefined options
+
+CONFIG -= debug
+CONFIG -= release
+
+#CONFIG += qt warn_on debug use_static
+
+#CONFIG += qt warn_on release use_static
+#CONFIG += qt warn_on debug use_dll
+CONFIG += qt warn_on release use_dll
+
+#----------------------------------------------------------------------
+# MS Windows
+#----------------------------------------------------------------------
+
+win32 {
+ use_dll {
+ DEFINES += QTTESTRUNNER_DLL
+ debug {
+ OBJECTS_DIR = DebugDLL
+ LIBS += ..\..\lib\cppunitd_dll.lib
+ LIBS += ..\..\lib\qttestrunnerd_dll.lib
+ }
+ release {
+ OBJECTS_DIR = ReleaseDLL
+ LIBS += ..\..\lib\cppunit_dll.lib
+ LIBS += ..\..\lib\qttestrunner_dll.lib
+ }
+ }
+ use_static {
+ debug {
+ OBJECTS_DIR = Debug
+ LIBS += ..\..\lib\cppunitd.lib
+ LIBS += ..\..\lib\qttestrunnerd.lib
+ }
+ release {
+ OBJECTS_DIR = Release
+ LIBS += ..\..\lib\cppunit.lib
+ LIBS += ..\..\lib\qttestrunner.lib
+ }
+ }
+ DESTDIR = $${OBJECTS_DIR}
+}
+
+#----------------------------------------------------------------------
+# Linux/Unix
+#----------------------------------------------------------------------
+
+unix {
+ message("NOT IMPLEMENTED YET!")
+}
+
+#----------------------------------------------------------------------
+
+HEADERS = \
+ ExampleTestCases.h
+
+SOURCES = \
+ ExampleTestCases.cpp \
+ Main.cpp
+
+INCLUDEPATH += . ../../include
diff --git a/examples/qt/run.bat b/examples/qt/run.bat
index b929646..eaab68e 100755
--- a/examples/qt/run.bat
+++ b/examples/qt/run.bat
@@ -1,2 +1,2 @@
SET PATH=%PATH%;..\..\lib
-Example.exe \ No newline at end of file
+Debug\qt_example.exe