summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/plugin/qpluginloader
diff options
context:
space:
mode:
authorRohan McGovern <rohan.mcgovern@nokia.com>2011-11-24 10:36:10 +1000
committerQt by Nokia <qt-info@nokia.com>2011-12-01 09:12:52 +0100
commit3385fb91e1e55e1bfa1f78dfb8ce2e9f3fdaedef (patch)
treeb77bb527bf3a21dc95a317248b2640c73751f629 /tests/auto/corelib/plugin/qpluginloader
parent13eba9ddf47d570fc4562c20fcfbacd1dfa4a61a (diff)
Fixed installation of corelib tests
In .pro files, removed wince/symbian-specific DEPLOYMENT cases and replaced them with TESTDATA where appropriate. In .cpp files, removed SRCDIR and relative paths to testdata and replaced them with the QFINDTESTDATA macro where appropriate. Modified test helper apps/libs to install themselves under the test they relate to. This change allows corelib tests to be correctly installed, along with their testdata, via `make install'. Change-Id: I5e202e2f3b577af7e39072d5c9fe13e0ca125304 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Diffstat (limited to 'tests/auto/corelib/plugin/qpluginloader')
-rw-r--r--tests/auto/corelib/plugin/qpluginloader/almostplugin/almostplugin.pro4
-rw-r--r--tests/auto/corelib/plugin/qpluginloader/lib/lib.pro5
-rw-r--r--tests/auto/corelib/plugin/qpluginloader/theplugin/theplugin.pro4
-rw-r--r--tests/auto/corelib/plugin/qpluginloader/tst/tst.pro7
-rw-r--r--tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp21
5 files changed, 22 insertions, 19 deletions
diff --git a/tests/auto/corelib/plugin/qpluginloader/almostplugin/almostplugin.pro b/tests/auto/corelib/plugin/qpluginloader/almostplugin/almostplugin.pro
index b45509ef01..333b19dad3 100644
--- a/tests/auto/corelib/plugin/qpluginloader/almostplugin/almostplugin.pro
+++ b/tests/auto/corelib/plugin/qpluginloader/almostplugin/almostplugin.pro
@@ -5,3 +5,7 @@ SOURCES = almostplugin.cpp
TARGET = almostplugin
DESTDIR = ../bin
*-g++*:QMAKE_LFLAGS -= -Wl,--no-undefined
+
+# This is testdata for the tst_qpluginloader test.
+target.path = $$[QT_INSTALL_TESTS]/tst_qpluginloader/bin
+INSTALLS += target
diff --git a/tests/auto/corelib/plugin/qpluginloader/lib/lib.pro b/tests/auto/corelib/plugin/qpluginloader/lib/lib.pro
index 1a784924b4..a45df7134a 100644
--- a/tests/auto/corelib/plugin/qpluginloader/lib/lib.pro
+++ b/tests/auto/corelib/plugin/qpluginloader/lib/lib.pro
@@ -9,5 +9,6 @@ QT = core
win32-msvc: DEFINES += WIN32_MSVC
win32-borland: DEFINES += WIN32_BORLAND
-#no special install rule for the library used by test
-INSTALLS =
+# This is testdata for the tst_qpluginloader test.
+target.path = $$[QT_INSTALL_TESTS]/tst_qpluginloader/bin
+INSTALLS += target
diff --git a/tests/auto/corelib/plugin/qpluginloader/theplugin/theplugin.pro b/tests/auto/corelib/plugin/qpluginloader/theplugin/theplugin.pro
index bd318a3c6f..382250ac98 100644
--- a/tests/auto/corelib/plugin/qpluginloader/theplugin/theplugin.pro
+++ b/tests/auto/corelib/plugin/qpluginloader/theplugin/theplugin.pro
@@ -4,3 +4,7 @@ HEADERS = theplugin.h
SOURCES = theplugin.cpp
TARGET = $$qtLibraryTarget(theplugin)
DESTDIR = ../bin
+
+# This is testdata for the tst_qpluginloader test.
+target.path = $$[QT_INSTALL_TESTS]/tst_qpluginloader/bin
+INSTALLS += target
diff --git a/tests/auto/corelib/plugin/qpluginloader/tst/tst.pro b/tests/auto/corelib/plugin/qpluginloader/tst/tst.pro
index 0de46be2c9..810efe856c 100644
--- a/tests/auto/corelib/plugin/qpluginloader/tst/tst.pro
+++ b/tests/auto/corelib/plugin/qpluginloader/tst/tst.pro
@@ -3,7 +3,6 @@ TARGET = ../tst_qpluginloader
QT = core testlib
SOURCES = ../tst_qpluginloader.cpp
HEADERS = ../theplugin/plugininterface.h
-DEFINES += SRCDIR=\\\"$$PWD/../\\\"
win32 {
CONFIG(debug, debug|release) {
@@ -13,10 +12,6 @@ win32 {
}
}
-wince* {
- addFiles.files = $$OUT_PWD/../bin/*.dll
- addFiles.path = bin
- DEPLOYMENT += addFiles
-}
+TESTDATA += ../elftest
mac: CONFIG += insignificant_test # QTBUG-22765
diff --git a/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp b/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp
index a874324c60..4b1ed7199d 100644
--- a/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp
+++ b/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp
@@ -95,8 +95,7 @@
static QString sys_qualifiedLibraryName(const QString &fileName)
{
- QString currDir = QDir::currentPath();
- return currDir + "/bin/" + PREFIX + fileName + SUFFIX;
+ return QFINDTESTDATA(QString("bin/%1%2%3").arg(PREFIX).arg(fileName).arg(SUFFIX));
}
//TESTED_CLASS=
@@ -249,8 +248,8 @@ void tst_QPluginLoader::deleteinstanceOnUnload()
void tst_QPluginLoader::loadDebugObj()
{
#if defined (__ELF__)
- QVERIFY(QFile::exists(SRCDIR "elftest/debugobj.so"));
- QPluginLoader lib1(SRCDIR "elftest/debugobj.so");
+ QVERIFY(QFile::exists(QFINDTESTDATA("elftest/debugobj.so")));
+ QPluginLoader lib1(QFINDTESTDATA("elftest/debugobj.so"));
QCOMPARE(lib1.load(), false);
#endif
}
@@ -259,21 +258,21 @@ void tst_QPluginLoader::loadCorruptElf()
{
#if defined (__ELF__)
if (sizeof(void*) == 8) {
- QVERIFY(QFile::exists(SRCDIR "elftest/corrupt1.elf64.so"));
+ QVERIFY(QFile::exists(QFINDTESTDATA("elftest/corrupt1.elf64.so")));
- QPluginLoader lib1(SRCDIR "elftest/corrupt1.elf64.so");
+ QPluginLoader lib1(QFINDTESTDATA("elftest/corrupt1.elf64.so"));
QCOMPARE(lib1.load(), false);
QVERIFY2(lib1.errorString().contains("not an ELF object"), qPrintable(lib1.errorString()));
- QPluginLoader lib2(SRCDIR "elftest/corrupt2.elf64.so");
+ QPluginLoader lib2(QFINDTESTDATA("elftest/corrupt2.elf64.so"));
QCOMPARE(lib2.load(), false);
QVERIFY2(lib2.errorString().contains("invalid"), qPrintable(lib2.errorString()));
- QPluginLoader lib3(SRCDIR "elftest/corrupt3.elf64.so");
+ QPluginLoader lib3(QFINDTESTDATA("elftest/corrupt3.elf64.so"));
QCOMPARE(lib3.load(), false);
QVERIFY2(lib3.errorString().contains("invalid"), qPrintable(lib3.errorString()));
} else if (sizeof(void*) == 4) {
- QPluginLoader libW(SRCDIR "elftest/corrupt3.elf64.so");
+ QPluginLoader libW(QFINDTESTDATA("elftest/corrupt3.elf64.so"));
QCOMPARE(libW.load(), false);
QVERIFY2(libW.errorString().contains("architecture"), qPrintable(libW.errorString()));
} else {
@@ -286,12 +285,12 @@ void tst_QPluginLoader::loadGarbage()
{
#if defined (Q_OS_UNIX)
for (int i=0; i<5; i++) {
- QPluginLoader lib(QString(SRCDIR "elftest/garbage%1.so").arg(i));
+ QPluginLoader lib(QFINDTESTDATA(QString("elftest/garbage%1.so").arg(i)));
QCOMPARE(lib.load(), false);
QVERIFY(lib.errorString() != QString("Unknown error"));
}
#endif
}
-QTEST_APPLESS_MAIN(tst_QPluginLoader)
+QTEST_MAIN(tst_QPluginLoader)
#include "tst_qpluginloader.moc"