summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2016-12-19 10:34:32 +0100
committerUlf Hermann <ulf.hermann@qt.io>2017-03-06 11:27:20 +0000
commitd6330a19b29ebff359a6746250c78437dbcaf77d (patch)
tree3ab0e390f0bfd30bb235ed5a0128bfd33e9cd4b7 /tests
parentf31dbeb4c7cd0d7559a8d7f523a3feea7d376186 (diff)
Use QT_CONFIG(library) instead of QT_NO_LIBRARY
For the windows file system engine, we add an extra macro to use library loading if configured to do so, but avoid it on WinRT, as none of the symbols would be found. We also QT_REQUIRE_CONFIG(library) in the library headers and exclude the sources from the build if library loading is disabled. This, in turn, makes it necessary to clean up some header inclusions. Change-Id: I2b152cb5b47a2658996b6f4702b038536a5704ec Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp1
-rw-r--r--tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp2
-rw-r--r--tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.h2
-rw-r--r--tests/auto/corelib/plugin/qfactoryloader/tst_qfactoryloader.cpp5
-rw-r--r--tests/auto/corelib/tools/qtextboundaryfinder/tst_qtextboundaryfinder.cpp4
-rw-r--r--tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp2
-rw-r--r--tests/auto/dbus/qdbustype/tst_qdbustype.cpp2
-rw-r--r--tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp1
-rw-r--r--tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp4
9 files changed, 12 insertions, 11 deletions
diff --git a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
index 7bdebd1593..87b579bb2b 100644
--- a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
+++ b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
@@ -31,7 +31,6 @@
#include <qfile.h>
#include <qdir.h>
#include <qcoreapplication.h>
-#include <qlibrary.h>
#include <qtemporaryfile.h>
#include <qtemporarydir.h>
#include <qdir.h>
diff --git a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp
index 0691297497..0feffe0e96 100644
--- a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp
+++ b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp
@@ -893,7 +893,7 @@ void tst_QCoreApplication::threadedEventDelivery()
QCOMPARE(receiver.recordedEvents.contains(QEvent::User + 1), eventsReceived);
}
-#ifndef QT_NO_LIBRARY
+#if QT_CONFIG(library)
void tst_QCoreApplication::addRemoveLibPaths()
{
QStringList paths = QCoreApplication::libraryPaths();
diff --git a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.h b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.h
index 7fb1bde459..381ff5d497 100644
--- a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.h
+++ b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.h
@@ -58,7 +58,7 @@ private slots:
void applicationEventFilters_auxThread();
void threadedEventDelivery_data();
void threadedEventDelivery();
-#ifndef QT_NO_LIBRARY
+#if QT_CONFIG(library)
void addRemoveLibPaths();
#endif
};
diff --git a/tests/auto/corelib/plugin/qfactoryloader/tst_qfactoryloader.cpp b/tests/auto/corelib/plugin/qfactoryloader/tst_qfactoryloader.cpp
index fe6b1ca299..34dc103672 100644
--- a/tests/auto/corelib/plugin/qfactoryloader/tst_qfactoryloader.cpp
+++ b/tests/auto/corelib/plugin/qfactoryloader/tst_qfactoryloader.cpp
@@ -29,11 +29,12 @@
#include <QtTest/qtest.h>
#include <QtCore/qdir.h>
#include <QtCore/qfileinfo.h>
+#include <QtCore/qplugin.h>
#include <private/qfactoryloader_p.h>
#include "plugin1/plugininterface1.h"
#include "plugin2/plugininterface2.h"
-#ifdef QT_NO_LIBRARY
+#if !QT_CONFIG(library)
Q_IMPORT_PLUGIN(Plugin1)
Q_IMPORT_PLUGIN(Plugin2)
#endif
@@ -54,7 +55,7 @@ void tst_QFactoryLoader::initTestCase()
{
const QString binFolder = QFINDTESTDATA(binFolderC);
QVERIFY2(!binFolder.isEmpty(), "Unable to locate 'bin' folder");
-#ifndef QT_NO_LIBRARY
+#if QT_CONFIG(library)
QCoreApplication::setLibraryPaths(QStringList(QFileInfo(binFolder).absolutePath()));
#endif
}
diff --git a/tests/auto/corelib/tools/qtextboundaryfinder/tst_qtextboundaryfinder.cpp b/tests/auto/corelib/tools/qtextboundaryfinder/tst_qtextboundaryfinder.cpp
index 4c9916cc52..5467d438a3 100644
--- a/tests/auto/corelib/tools/qtextboundaryfinder/tst_qtextboundaryfinder.cpp
+++ b/tests/auto/corelib/tools/qtextboundaryfinder/tst_qtextboundaryfinder.cpp
@@ -751,7 +751,9 @@ void tst_QTextBoundaryFinder::isAtSoftHyphen()
doTestData(testString, expectedSoftHyphenPositions, QTextBoundaryFinder::Line, QTextBoundaryFinder::SoftHyphen);
}
+#if QT_CONFIG(library)
#include <qlibrary.h>
+#endif
#define LIBTHAI_MAJOR 0
typedef int (*th_brk_def) (const unsigned char*, int*, size_t);
@@ -759,7 +761,7 @@ static th_brk_def th_brk = 0;
static bool init_libthai()
{
-#if !defined(QT_NO_LIBRARY)
+#if QT_CONFIG(library)
static bool triedResolve = false;
if (!triedResolve) {
th_brk = (th_brk_def) QLibrary::resolve("thai", (int)LIBTHAI_MAJOR, "th_brk");
diff --git a/tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp b/tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp
index c5117228d3..6b4ddeaba5 100644
--- a/tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp
+++ b/tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp
@@ -1084,7 +1084,7 @@ static bool canSendUnixFd(DBusConnection *connection)
# if DBUS_VERSION-0 >= 0x010400
can_send_type = dbus_connection_can_send_type;
# endif
-#elif !defined(QT_NO_LIBRARY)
+#elif QT_CONFIG(library)
// run-time check if the next functions are available
can_send_type = (can_send_type_t)qdbus_resolve_conditionally("dbus_connection_can_send_type");
#endif
diff --git a/tests/auto/dbus/qdbustype/tst_qdbustype.cpp b/tests/auto/dbus/qdbustype/tst_qdbustype.cpp
index d9a4a6c43f..f475e87a2b 100644
--- a/tests/auto/dbus/qdbustype/tst_qdbustype.cpp
+++ b/tests/auto/dbus/qdbustype/tst_qdbustype.cpp
@@ -90,7 +90,7 @@ static void addFixedTypes()
// the library recognizes this as valid type first.
// The following function was added for Unix FD support, so if it is
// present, so is support for Unix FDs.
-# ifndef QT_NO_LIBRARY
+# if QT_CONFIG(library)
bool supportsUnixFds = qdbus_resolve_conditionally("dbus_connection_can_send_type");
# else
bool supportsUnixFds = false;
diff --git a/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp b/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp
index f6d9b71aa2..0c01657956 100644
--- a/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp
+++ b/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp
@@ -54,7 +54,6 @@
#endif
#include <time.h>
-#include <qlibrary.h>
#if defined(Q_OS_WIN)
#include <windows.h>
#else
diff --git a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
index 13994e3b02..49095b9625 100644
--- a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
+++ b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
@@ -121,7 +121,7 @@ private slots:
void testDeleteLater();
void testDeleteLaterProcessEvents();
-#ifndef QT_NO_LIBRARY
+#if QT_CONFIG(library)
void libraryPaths();
void libraryPaths_qt_plugin_path();
void libraryPaths_qt_plugin_path_2();
@@ -885,7 +885,7 @@ bool isPathListIncluded(const QStringList &l, const QStringList &r)
return j == r.count();
}
-#ifndef QT_NO_LIBRARY
+#if QT_CONFIG(library)
#define QT_TST_QAPP_DEBUG
void tst_QApplication::libraryPaths()
{