summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/plugin
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@theqtcompany.com>2015-06-19 13:29:55 +0200
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2015-08-18 19:59:46 +0000
commit6c76fdc7616ac3b62c5750600bd6d5985dbceb20 (patch)
tree5f8ec6d8b0b444d07d9fe3780acf77996157c890 /tests/auto/corelib/plugin
parent1f437e7540cbdfca8adcad0b69ae26237846ab23 (diff)
Allow loading of static plugins if QT_NO_LIBRARY is set.
We keep two symbols from QPluginLoader defined, even if QT_NO_LIBRARY is set in order to be able to locate static plugins. This doesn't constitute any loading of shared libraries or plugins from external files at runtime. Using these symbols we can enable most of QFactoryLoader even if QT_NO_LIBRARY is set. Only update(), refreshAll(), library() and the dtor make no sense then. This way QGenericPlugin also becomes useful with QT_NO_LIBRARY. Task-number: QTBUG-3045 Change-Id: Ib7842ce5799e8e2caa46431d95fddd1adda0fc41 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib/plugin')
-rw-r--r--tests/auto/corelib/plugin/qfactoryloader/test/test.pro5
-rw-r--r--tests/auto/corelib/plugin/qfactoryloader/tst_qfactoryloader.cpp8
2 files changed, 12 insertions, 1 deletions
diff --git a/tests/auto/corelib/plugin/qfactoryloader/test/test.pro b/tests/auto/corelib/plugin/qfactoryloader/test/test.pro
index d8dfaac29e..5e7f44c005 100644
--- a/tests/auto/corelib/plugin/qfactoryloader/test/test.pro
+++ b/tests/auto/corelib/plugin/qfactoryloader/test/test.pro
@@ -20,3 +20,8 @@ win32 {
mac: CONFIG -= app_bundle
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
+
+load(qfeatures)
+contains(QT_DISABLED_FEATURES, library) {
+ LIBS += -L ../bin/ -lplugin1 -lplugin2
+}
diff --git a/tests/auto/corelib/plugin/qfactoryloader/tst_qfactoryloader.cpp b/tests/auto/corelib/plugin/qfactoryloader/tst_qfactoryloader.cpp
index 474f4e9868..92a4dda252 100644
--- a/tests/auto/corelib/plugin/qfactoryloader/tst_qfactoryloader.cpp
+++ b/tests/auto/corelib/plugin/qfactoryloader/tst_qfactoryloader.cpp
@@ -38,6 +38,11 @@
#include "plugin1/plugininterface1.h"
#include "plugin2/plugininterface2.h"
+#ifdef QT_NO_LIBRARY
+Q_IMPORT_PLUGIN(Plugin1)
+Q_IMPORT_PLUGIN(Plugin2)
+#endif
+
class tst_QFactoryLoader : public QObject
{
Q_OBJECT
@@ -54,8 +59,9 @@ void tst_QFactoryLoader::initTestCase()
{
const QString binFolder = QFINDTESTDATA(binFolderC);
QVERIFY2(!binFolder.isEmpty(), "Unable to locate 'bin' folder");
-
+#ifndef QT_NO_LIBRARY
QCoreApplication::setLibraryPaths(QStringList(QFileInfo(binFolder).absolutePath()));
+#endif
}
void tst_QFactoryLoader::usingTwoFactoriesFromSameDir()