From 2b18939f83d596e8fff3da56314966d656ccfa0c Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 20 Jul 2015 15:10:33 +0200 Subject: [PATCH] Fix building with QT_NO_LIBRARY If QT_NO_LIBRARY isn't set we cannot test QCoreApplication's library path functions and none of the plugin and library related tests are applicable. Also, examples that rely on dynamic plugin loading for their core functionality obviously don't work. Change-Id: I2d381ee1bc8d944e1181557895a7e92a364fd778 Reviewed-by: Thiago Macieira --- examples/widgets/tools/tools.pro | 8 ++++++++ .../kernel/qcoreapplication/tst_qcoreapplication.cpp | 2 ++ .../kernel/qcoreapplication/tst_qcoreapplication.h | 2 ++ tests/auto/corelib/plugin/plugin.pro | 9 ++++++--- .../widgets/kernel/qapplication/tst_qapplication.cpp | 4 ++++ 5 files changed, 22 insertions(+), 3 deletions(-) diff --git a/examples/widgets/tools/tools.pro b/examples/widgets/tools/tools.pro index 282f8dedeaf..503efa84032 100644 --- a/examples/widgets/tools/tools.pro +++ b/examples/widgets/tools/tools.pro @@ -18,3 +18,11 @@ SUBDIRS = \ contains(DEFINES, QT_NO_TRANSLATION): SUBDIRS -= i18n plugandpaint.depends = plugandpaintplugins + +load(qfeatures) +contains(QT_DISABLED_FEATURES, library) { + SUBDIRS -= \ + echoplugin \ + plugandpaintplugins \ + plugandpaint +} diff --git a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp index cecc02bf251..a0cadc9a2f8 100644 --- a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp +++ b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp @@ -903,6 +903,7 @@ void tst_QCoreApplication::threadedEventDelivery() QCOMPARE(receiver.recordedEvents.contains(QEvent::User + 1), eventsReceived); } +#ifndef QT_NO_LIBRARY void tst_QCoreApplication::addRemoveLibPaths() { QStringList paths = QCoreApplication::libraryPaths(); @@ -929,6 +930,7 @@ void tst_QCoreApplication::addRemoveLibPaths() QCoreApplication::setLibraryPaths(replace); QCOMPARE(QCoreApplication::libraryPaths(), replace); } +#endif static void createQObjectOnDestruction() { diff --git a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.h b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.h index d9296b3846a..6c24ab56f81 100644 --- a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.h +++ b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.h @@ -63,7 +63,9 @@ private slots: void applicationEventFilters_auxThread(); void threadedEventDelivery_data(); void threadedEventDelivery(); +#ifndef QT_NO_LIBRARY void addRemoveLibPaths(); +#endif }; #endif // TST_QCOREAPPLICATION_H diff --git a/tests/auto/corelib/plugin/plugin.pro b/tests/auto/corelib/plugin/plugin.pro index 506f6abaebb..e6b748e4f4a 100644 --- a/tests/auto/corelib/plugin/plugin.pro +++ b/tests/auto/corelib/plugin/plugin.pro @@ -1,7 +1,10 @@ TEMPLATE=subdirs SUBDIRS=\ qfactoryloader \ - qlibrary \ - qplugin \ - qpluginloader \ quuid + +load(qfeatures) +!contains(QT_DISABLED_FEATURES, library): SUBDIRS += \ + qpluginloader \ + qplugin \ + qlibrary diff --git a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp index 878136b4a0d..9f5b9b71f46 100644 --- a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp +++ b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp @@ -133,9 +133,11 @@ private slots: void testDeleteLater(); void testDeleteLaterProcessEvents(); +#ifndef QT_NO_LIBRARY void libraryPaths(); void libraryPaths_qt_plugin_path(); void libraryPaths_qt_plugin_path_2(); +#endif void sendPostedEvents(); @@ -909,6 +911,7 @@ bool isPathListIncluded(const QStringList &l, const QStringList &r) return j == r.count(); } +#ifndef QT_NO_LIBRARY #define QT_TST_QAPP_DEBUG void tst_QApplication::libraryPaths() { @@ -1114,6 +1117,7 @@ void tst_QApplication::libraryPaths_qt_plugin_path_2() qputenv("QT_PLUGIN_PATH", QByteArray()); } } +#endif class SendPostedEventsTester : public QObject {