summaryrefslogtreecommitdiffstats
path: root/tests/auto/qlibrary/lib
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2009-03-23 09:34:13 (GMT)
committerSimon Hausmann <simon.hausmann@nokia.com>2009-03-23 09:34:13 (GMT)
commit67ad0519fd165acee4a4d2a94fa502e9e4847bd0 (patch)
tree1dbf50b3dff8d5ca7e9344733968c72704eb15ff /tests/auto/qlibrary/lib
downloadQt-67ad0519fd165acee4a4d2a94fa502e9e4847bd0.zip
Qt-67ad0519fd165acee4a4d2a94fa502e9e4847bd0.tar.gz
Qt-67ad0519fd165acee4a4d2a94fa502e9e4847bd0.tar.bz2
Long live Qt!
Diffstat (limited to 'tests/auto/qlibrary/lib')
-rw-r--r--tests/auto/qlibrary/lib/lib.pro30
-rw-r--r--tests/auto/qlibrary/lib/mylib.c19
2 files changed, 49 insertions, 0 deletions
diff --git a/tests/auto/qlibrary/lib/lib.pro b/tests/auto/qlibrary/lib/lib.pro
new file mode 100644
index 0000000..14b8783
--- /dev/null
+++ b/tests/auto/qlibrary/lib/lib.pro
@@ -0,0 +1,30 @@
+TEMPLATE = lib
+CONFIG += dll
+CONFIG -= staticlib
+SOURCES = mylib.c
+TARGET = mylib
+DESTDIR = ../
+QT = core
+
+wince*: DEFINES += WIN32_MSVC
+win32-msvc: DEFINES += WIN32_MSVC
+win32-borland: DEFINES += WIN32_BORLAND
+
+# Force a copy of the library to have an extension that is non-standard.
+# We want to test if we can load a shared library with *any* filename...
+
+# For windows test if we can load a filename with multiple dots.
+win32: {
+ QMAKE_POST_LINK = copy /Y $(DESTDIR_TARGET) ..\mylib.dl2 && \
+ copy /Y $(DESTDIR_TARGET) ..\system.trolltech.test.mylib.dll && \
+ copy /Y $(DESTDIR_TARGET) ..\mylib_noextension
+}
+unix: {
+ QMAKE_POST_LINK = cp -f $(DESTDIR)$(TARGET) ../libmylib.so2 && \
+ cp -f $(DESTDIR)$(TARGET) ../system.trolltech.test.mylib.so
+}
+
+#no special install rule for the library used by test
+INSTALLS =
+
+
diff --git a/tests/auto/qlibrary/lib/mylib.c b/tests/auto/qlibrary/lib/mylib.c
new file mode 100644
index 0000000..1366b7c
--- /dev/null
+++ b/tests/auto/qlibrary/lib/mylib.c
@@ -0,0 +1,19 @@
+#include <qglobal.h>
+
+#if defined(Q_CC_MSVC) || defined(Q_CC_MSVC_NET) || defined(Q_CC_BOR)
+#define LIB_EXPORT __declspec(dllexport)
+#else
+#define LIB_EXPORT
+#endif
+
+#if defined(Q_CC_BOR)
+# define BORLAND_STDCALL __stdcall
+#else
+# define BORLAND_STDCALL
+#endif
+
+LIB_EXPORT int BORLAND_STDCALL version()
+{
+ return 1;
+}
+