summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2017-01-09 11:39:46 +0100
committerUlf Hermann <ulf.hermann@qt.io>2018-03-21 10:31:20 +0000
commit90ec3aba06d9832b802df3e5eb77221b2bb31bdb (patch)
tree9cc17434c494e35a9470202bb97df2572801979a
parent955cf40b18ba37c46d692206c5fc39e93bfda01c (diff)
Clean up the moc "no-keywords" test
We can use the QT_LIB_FOO #defines instead of our own WITH_FOO ones to determine if a library is available. Also, it doesn't currently make sense to refer to libraries which are not part of qtbase here. We might add that in the future, but QtScript (being deprecated) is probably not the first one we should add. Change-Id: I7f2397ca5499ba6003088478161182e960e815fb Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
-rw-r--r--tests/auto/tools/moc/moc.pro10
-rw-r--r--tests/auto/tools/moc/no-keywords.h15
2 files changed, 14 insertions, 11 deletions
diff --git a/tests/auto/tools/moc/moc.pro b/tests/auto/tools/moc/moc.pro
index d2b13f9c4e..3cbc9ebb5e 100644
--- a/tests/auto/tools/moc/moc.pro
+++ b/tests/auto/tools/moc/moc.pro
@@ -36,11 +36,11 @@ if(*-g++*|*-icc*|*-clang*|*-llvm):!win32-*: HEADERS += os9-newlines.h win-newlin
if(*-g++*|*-clang*): HEADERS += dollars.h
SOURCES += tst_moc.cpp
-QT = core sql network testlib
-qtHaveModule(dbus) {
- DEFINES += WITH_DBUS
- QT += dbus
-}
+QT = core testlib
+qtHaveModule(dbus): QT += dbus
+qtHaveModule(concurrent): QT += concurrent
+qtHaveModule(network): QT += network
+qtHaveModule(sql): QT += sql
# tst_Moc::specifyMetaTagsFromCmdline()
# Ensure that plugin_metadata.h are moc-ed with some extra -M arguments:
diff --git a/tests/auto/tools/moc/no-keywords.h b/tests/auto/tools/moc/no-keywords.h
index d31063665b..ca77056503 100644
--- a/tests/auto/tools/moc/no-keywords.h
+++ b/tests/auto/tools/moc/no-keywords.h
@@ -37,16 +37,19 @@
#define slots Baz
#define emit Yoyodyne
+#include <QtCore/QtCore>
+
+#ifdef QT_CONCURRENT_LIB
#include <QtConcurrent/QtConcurrent>
-#include <QtCore>
+#endif
+#ifdef QT_NETWORK_LIB
#include <QtNetwork/QtNetwork>
+#endif
+#ifdef QT_SQL_LIB
#include <QtSql/QtSql>
-//#include <QtSvg>
-#if defined(WITH_DBUS)
-#include <QtDBus>
#endif
-#ifdef QT_SCRIPT_LIB
-#include <QtScript>
+#ifdef QT_DBUS_LIB
+#include <QtDBus/QtDBus>
#endif
#undef signals