summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@digia.com>2012-12-21 12:09:56 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-12-21 19:05:02 +0100
commit586adeabe4d58a7c8a71bbb1be79c3533ab858ff (patch)
tree62a13574bca965442bc1c66bd63d54550e3db7a0 /tests
parent7706c31eaa686299d7e22da809fec00c0db47c86 (diff)
add and use qtHaveModule() function
this is much more elegant than the so far propagated !isEmpty(QT.foo.name). also replace feature-specific tests (no-gui and no-widgets) and the obsolete contains(QT_CONFIG, foo) syntax. Change-Id: Ia4b3c8febcabf9eeca67b1f9173a523820b1038b Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com> Reviewed-by: Tasuku Suzuki <stasuku@gmail.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/auto.pro8
-rw-r--r--tests/auto/corelib/animation/animation.pro2
-rw-r--r--tests/auto/corelib/io/qprocess/qprocess.pri2
-rw-r--r--tests/auto/corelib/itemmodels/itemmodels.pro2
-rw-r--r--tests/auto/corelib/kernel/qpointer/qpointer.pro2
-rw-r--r--tests/auto/corelib/statemachine/qstatemachine/qstatemachine.pro2
-rw-r--r--tests/auto/gui/image/qicon/qicon.pro2
-rw-r--r--tests/auto/gui/image/qmovie/qmovie.pro2
-rw-r--r--tests/auto/gui/image/qpicture/qpicture.pro2
-rw-r--r--tests/auto/gui/image/qpixmap/qpixmap.pro2
-rw-r--r--tests/auto/gui/itemmodels/itemmodels.pro2
-rw-r--r--tests/auto/gui/kernel/kernel.pro2
-rw-r--r--tests/auto/gui/painting/qpainter/qpainter.pro4
-rw-r--r--tests/auto/gui/text/qfont/qfont.pro2
-rw-r--r--tests/auto/gui/text/qsyntaxhighlighter/qsyntaxhighlighter.pro2
-rw-r--r--tests/auto/gui/text/qtextdocumentlayout/qtextdocumentlayout.pro2
-rw-r--r--tests/auto/gui/text/qtextobject/qtextobject.pro2
-rw-r--r--tests/auto/gui/text/qtexttable/qtexttable.pro2
-rw-r--r--tests/auto/opengl/qgl/qgl.pro2
-rw-r--r--tests/auto/opengl/qglbuffer/qglbuffer.pro2
-rw-r--r--tests/auto/opengl/qglfunctions/qglfunctions.pro2
-rw-r--r--tests/auto/opengl/qglthreads/qglthreads.pro2
-rw-r--r--tests/auto/other/atwrapper/atWrapper.pro2
-rw-r--r--tests/auto/other/other.pro2
-rw-r--r--tests/auto/sql/models/models.pro2
-rw-r--r--tests/auto/tools/moc/moc.pro2
-rw-r--r--tests/auto/tools/tools.pro2
-rw-r--r--tests/auto/widgets/widgets/qmdiarea/qmdiarea.pro2
-rw-r--r--tests/benchmarks/benchmarks.pro4
-rw-r--r--tests/benchmarks/corelib/kernel/kernel.pro2
-rw-r--r--tests/benchmarks/corelib/tools/qregexp/qregexp.pro2
-rw-r--r--tests/benchmarks/gui/animation/animation.pro2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/GraphicsViewBenchmark.pro2
-rw-r--r--tests/benchmarks/gui/graphicsview/graphicsview.pro2
-rw-r--r--tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/chip.pro2
-rw-r--r--tests/benchmarks/gui/graphicsview/qgraphicsview/chiptester/chiptester.pri2
-rw-r--r--tests/benchmarks/gui/gui.pro2
-rw-r--r--tests/benchmarks/gui/image/image.pro2
-rw-r--r--tests/benchmarks/gui/kernel/kernel.pro2
-rw-r--r--tests/benchmarks/gui/painting/painting.pro2
-rw-r--r--tests/benchmarks/gui/styles/styles.pro2
-rw-r--r--tests/manual/lance/lance.pro2
42 files changed, 47 insertions, 47 deletions
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro
index b3906cc247..6ff0734186 100644
--- a/tests/auto/auto.pro
+++ b/tests/auto/auto.pro
@@ -18,7 +18,7 @@ SUBDIRS += \
wince*: SUBDIRS -= printsupport
cross_compile: SUBDIRS -= tools
-isEmpty(QT.opengl.name): SUBDIRS -= opengl
-!unix|embedded|!contains(QT_CONFIG, dbus): SUBDIRS -= dbus
-contains(QT_CONFIG, no-widgets): SUBDIRS -= widgets printsupport
-!contains(QT_CONFIG, concurrent): SUBDIRS -= concurrent
+!qtHaveModule(opengl): SUBDIRS -= opengl
+!unix|embedded|!qtHaveModule(dbus): SUBDIRS -= dbus
+!qtHaveModule(widgets): SUBDIRS -= widgets printsupport
+!qtHaveModule(concurrent): SUBDIRS -= concurrent
diff --git a/tests/auto/corelib/animation/animation.pro b/tests/auto/corelib/animation/animation.pro
index 563b7184bf..30c98f4a11 100644
--- a/tests/auto/corelib/animation/animation.pro
+++ b/tests/auto/corelib/animation/animation.pro
@@ -8,5 +8,5 @@ SUBDIRS=\
qsequentialanimationgroup \
qvariantanimation
-contains(QT_CONFIG, no-widgets): SUBDIRS -= \
+!qtHaveModule(widgets): SUBDIRS -= \
qpropertyanimation
diff --git a/tests/auto/corelib/io/qprocess/qprocess.pri b/tests/auto/corelib/io/qprocess/qprocess.pri
index d139b3dcef..430251fbf1 100644
--- a/tests/auto/corelib/io/qprocess/qprocess.pri
+++ b/tests/auto/corelib/io/qprocess/qprocess.pri
@@ -17,5 +17,5 @@ SUBPROGRAMS = \
!contains(QMAKE_PLATFORM, wince): SUBPROGRAMS += testForwarding
-contains(QT_CONFIG, no-widgets): SUBPROGRAMS -= \
+!qtHaveModule(widgets): SUBPROGRAMS -= \
testGuiProcess
diff --git a/tests/auto/corelib/itemmodels/itemmodels.pro b/tests/auto/corelib/itemmodels/itemmodels.pro
index 5221bfae81..2f681c3330 100644
--- a/tests/auto/corelib/itemmodels/itemmodels.pro
+++ b/tests/auto/corelib/itemmodels/itemmodels.pro
@@ -3,7 +3,7 @@ TEMPLATE=subdirs
SUBDIRS = qabstractitemmodel \
qstringlistmodel
-!contains(QT_CONFIG, no-widgets): SUBDIRS += \
+qtHaveModule(widgets): SUBDIRS += \
qabstractproxymodel \
qidentityproxymodel \
qitemmodel \
diff --git a/tests/auto/corelib/kernel/qpointer/qpointer.pro b/tests/auto/corelib/kernel/qpointer/qpointer.pro
index 6c076e630f..8786d07292 100644
--- a/tests/auto/corelib/kernel/qpointer/qpointer.pro
+++ b/tests/auto/corelib/kernel/qpointer/qpointer.pro
@@ -2,6 +2,6 @@ CONFIG += testcase
CONFIG += parallel_test
TARGET = tst_qpointer
QT += testlib
-!contains(QT_CONFIG, no-widgets): QT += widgets
+qtHaveModule(widgets): QT += widgets
SOURCES = tst_qpointer.cpp
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/corelib/statemachine/qstatemachine/qstatemachine.pro b/tests/auto/corelib/statemachine/qstatemachine/qstatemachine.pro
index 1708735c52..b830efe3a5 100644
--- a/tests/auto/corelib/statemachine/qstatemachine/qstatemachine.pro
+++ b/tests/auto/corelib/statemachine/qstatemachine/qstatemachine.pro
@@ -2,6 +2,6 @@ CONFIG += testcase
CONFIG += parallel_test
TARGET = tst_qstatemachine
QT = core-private testlib gui
-!contains(QT_CONFIG, no-widgets): QT += widgets
+qtHaveModule(widgets): QT += widgets
SOURCES = tst_qstatemachine.cpp
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/gui/image/qicon/qicon.pro b/tests/auto/gui/image/qicon/qicon.pro
index d4ade0e8ab..337b938915 100644
--- a/tests/auto/gui/image/qicon/qicon.pro
+++ b/tests/auto/gui/image/qicon/qicon.pro
@@ -3,7 +3,7 @@ CONFIG += parallel_test
TARGET = tst_qicon
QT += testlib
-!contains(QT_CONFIG, no-widgets): QT += widgets
+qtHaveModule(widgets): QT += widgets
SOURCES += tst_qicon.cpp
RESOURCES = tst_qicon.qrc
diff --git a/tests/auto/gui/image/qmovie/qmovie.pro b/tests/auto/gui/image/qmovie/qmovie.pro
index a511f0b258..9290588625 100644
--- a/tests/auto/gui/image/qmovie/qmovie.pro
+++ b/tests/auto/gui/image/qmovie/qmovie.pro
@@ -2,7 +2,7 @@ CONFIG += testcase
CONFIG += parallel_test
TARGET = tst_qmovie
QT += testlib
-!contains(QT_CONFIG, no-widgets): QT += widgets
+qtHaveModule(widgets): QT += widgets
SOURCES += tst_qmovie.cpp
MOC_DIR=tmp
diff --git a/tests/auto/gui/image/qpicture/qpicture.pro b/tests/auto/gui/image/qpicture/qpicture.pro
index 8a93584aaa..b4927b4536 100644
--- a/tests/auto/gui/image/qpicture/qpicture.pro
+++ b/tests/auto/gui/image/qpicture/qpicture.pro
@@ -2,7 +2,7 @@ CONFIG += testcase
CONFIG += parallel_test
TARGET = tst_qpicture
QT += testlib
-!contains(QT_CONFIG, no-widgets): QT += widgets
+qtHaveModule(widgets): QT += widgets
SOURCES += tst_qpicture.cpp
diff --git a/tests/auto/gui/image/qpixmap/qpixmap.pro b/tests/auto/gui/image/qpixmap/qpixmap.pro
index f079f56864..6188bf2c6e 100644
--- a/tests/auto/gui/image/qpixmap/qpixmap.pro
+++ b/tests/auto/gui/image/qpixmap/qpixmap.pro
@@ -2,7 +2,7 @@ CONFIG += testcase
TARGET = tst_qpixmap
QT += core-private gui-private testlib
-!contains(QT_CONFIG, no-widgets): QT += widgets widgets-private
+qtHaveModule(widgets): QT += widgets widgets-private
SOURCES += tst_qpixmap.cpp
!wince* {
diff --git a/tests/auto/gui/itemmodels/itemmodels.pro b/tests/auto/gui/itemmodels/itemmodels.pro
index 169100f486..8a300d0210 100644
--- a/tests/auto/gui/itemmodels/itemmodels.pro
+++ b/tests/auto/gui/itemmodels/itemmodels.pro
@@ -3,5 +3,5 @@ SUBDIRS= \
qstandarditem \
qstandarditemmodel
-isEmpty(QT.widgets.name):SUBDIRS -= \
+!qtHaveModule(widgets): SUBDIRS -= \
qstandarditemmodel
diff --git a/tests/auto/gui/kernel/kernel.pro b/tests/auto/gui/kernel/kernel.pro
index fb8cd2d566..7e3f25d377 100644
--- a/tests/auto/gui/kernel/kernel.pro
+++ b/tests/auto/gui/kernel/kernel.pro
@@ -19,6 +19,6 @@ SUBDIRS=\
qwindow \
qguiapplication \
-contains(QT_CONFIG, no-widgets): SUBDIRS -= \
+!qtHaveModule(widgets): SUBDIRS -= \
qmouseevent_modal \
qtouchevent
diff --git a/tests/auto/gui/painting/qpainter/qpainter.pro b/tests/auto/gui/painting/qpainter/qpainter.pro
index 90a801ecb3..a30564cc50 100644
--- a/tests/auto/gui/painting/qpainter/qpainter.pro
+++ b/tests/auto/gui/painting/qpainter/qpainter.pro
@@ -3,8 +3,8 @@ CONFIG += parallel_test
TARGET = tst_qpainter
QT += testlib
-!contains(QT_CONFIG, no-widgets): QT += widgets widgets-private
-!contains(QT_CONFIG, no-widgets):!wince*: QT += printsupport
+qtHaveModule(widgets): QT += widgets widgets-private
+qtHaveModule(widgets):!wince*: QT += printsupport
SOURCES += tst_qpainter.cpp
diff --git a/tests/auto/gui/text/qfont/qfont.pro b/tests/auto/gui/text/qfont/qfont.pro
index 562294dd66..ced66c226c 100644
--- a/tests/auto/gui/text/qfont/qfont.pro
+++ b/tests/auto/gui/text/qfont/qfont.pro
@@ -3,7 +3,7 @@ CONFIG += parallel_test
TARGET = tst_qfont
QT += testlib
QT += core-private gui-private
-!contains(QT_CONFIG, no-widgets): QT += widgets
+qtHaveModule(widgets): QT += widgets
SOURCES += tst_qfont.cpp
diff --git a/tests/auto/gui/text/qsyntaxhighlighter/qsyntaxhighlighter.pro b/tests/auto/gui/text/qsyntaxhighlighter/qsyntaxhighlighter.pro
index c8db4df90e..24b58c7d3e 100644
--- a/tests/auto/gui/text/qsyntaxhighlighter/qsyntaxhighlighter.pro
+++ b/tests/auto/gui/text/qsyntaxhighlighter/qsyntaxhighlighter.pro
@@ -3,5 +3,5 @@ CONFIG += parallel_test
TARGET = tst_qsyntaxhighlighter
SOURCES += tst_qsyntaxhighlighter.cpp
QT += testlib
-!contains(QT_CONFIG, no-widgets) QT += widgets
+qtHaveModule(widgets) QT += widgets
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/gui/text/qtextdocumentlayout/qtextdocumentlayout.pro b/tests/auto/gui/text/qtextdocumentlayout/qtextdocumentlayout.pro
index d439e0deb9..76dd370a8d 100644
--- a/tests/auto/gui/text/qtextdocumentlayout/qtextdocumentlayout.pro
+++ b/tests/auto/gui/text/qtextdocumentlayout/qtextdocumentlayout.pro
@@ -2,7 +2,7 @@ CONFIG += testcase
CONFIG += parallel_test
TARGET = tst_qtextdocumentlayout
QT += testlib
-!contains(QT_CONFIG, no-widgets) QT += widgets
+qtHaveModule(widgets) QT += widgets
SOURCES += tst_qtextdocumentlayout.cpp
diff --git a/tests/auto/gui/text/qtextobject/qtextobject.pro b/tests/auto/gui/text/qtextobject/qtextobject.pro
index 59312ac1d5..ebeba2a64a 100644
--- a/tests/auto/gui/text/qtextobject/qtextobject.pro
+++ b/tests/auto/gui/text/qtextobject/qtextobject.pro
@@ -6,7 +6,7 @@ CONFIG += testcase
CONFIG += parallel_test
TARGET = tst_qtextobject
QT += testlib
-!contains(QT_CONFIG, no-widgets): QT += widgets
+qtHaveModule(widgets): QT += widgets
SOURCES += tst_qtextobject.cpp
diff --git a/tests/auto/gui/text/qtexttable/qtexttable.pro b/tests/auto/gui/text/qtexttable/qtexttable.pro
index a1034dac67..1c59bf1471 100644
--- a/tests/auto/gui/text/qtexttable/qtexttable.pro
+++ b/tests/auto/gui/text/qtexttable/qtexttable.pro
@@ -2,7 +2,7 @@ CONFIG += testcase
CONFIG += parallel_test
TARGET = tst_qtexttable
QT += testlib
-!contains(QT_CONFIG, no-widgets): QT += widgets
+qtHaveModule(widgets): QT += widgets
SOURCES += tst_qtexttable.cpp
diff --git a/tests/auto/opengl/qgl/qgl.pro b/tests/auto/opengl/qgl/qgl.pro
index e5aff000ac..311e41a624 100644
--- a/tests/auto/opengl/qgl/qgl.pro
+++ b/tests/auto/opengl/qgl/qgl.pro
@@ -4,7 +4,7 @@
CONFIG += testcase
TARGET = tst_qgl
-requires(contains(QT_CONFIG,opengl))
+requires(qtHaveModule(opengl))
QT += widgets widgets-private opengl-private gui-private core-private testlib
SOURCES += tst_qgl.cpp
diff --git a/tests/auto/opengl/qglbuffer/qglbuffer.pro b/tests/auto/opengl/qglbuffer/qglbuffer.pro
index 4d102415a8..72117322da 100644
--- a/tests/auto/opengl/qglbuffer/qglbuffer.pro
+++ b/tests/auto/opengl/qglbuffer/qglbuffer.pro
@@ -5,7 +5,7 @@
CONFIG += testcase
CONFIG += parallel_test
TARGET = tst_qglbuffer
-requires(contains(QT_CONFIG,opengl))
+requires(qtHaveModule(opengl))
QT += opengl widgets testlib
SOURCES += tst_qglbuffer.cpp
diff --git a/tests/auto/opengl/qglfunctions/qglfunctions.pro b/tests/auto/opengl/qglfunctions/qglfunctions.pro
index 321f62534e..a512ea0dd9 100644
--- a/tests/auto/opengl/qglfunctions/qglfunctions.pro
+++ b/tests/auto/opengl/qglfunctions/qglfunctions.pro
@@ -1,7 +1,7 @@
CONFIG += testcase
CONFIG += parallel_test
TARGET = tst_qglfunctions
-requires(contains(QT_CONFIG,opengl))
+requires(qtHaveModule(opengl))
QT += opengl widgets testlib
SOURCES += tst_qglfunctions.cpp
diff --git a/tests/auto/opengl/qglthreads/qglthreads.pro b/tests/auto/opengl/qglthreads/qglthreads.pro
index d5cbd0d9ed..3502c41c87 100644
--- a/tests/auto/opengl/qglthreads/qglthreads.pro
+++ b/tests/auto/opengl/qglthreads/qglthreads.pro
@@ -1,6 +1,6 @@
CONFIG += testcase
TARGET = tst_qglthreads
-requires(contains(QT_CONFIG,opengl))
+requires(qtHaveModule(opengl))
QT += opengl widgets testlib gui-private core-private
HEADERS += tst_qglthreads.h
diff --git a/tests/auto/other/atwrapper/atWrapper.pro b/tests/auto/other/atwrapper/atWrapper.pro
index d14293302e..1617ae89d1 100644
--- a/tests/auto/other/atwrapper/atWrapper.pro
+++ b/tests/auto/other/atwrapper/atWrapper.pro
@@ -6,7 +6,7 @@ DEFINES += SRCDIR=\\\"$$PWD\\\"
QT += xml svg network testlib
-contains(QT_CONFIG, opengl):QT += opengl
+qtHaveModule(opengl): QT += opengl
include($$ARTHUR/datagenerator/datagenerator.pri)
diff --git a/tests/auto/other/other.pro b/tests/auto/other/other.pro
index eb6ed667a8..ea6290db42 100644
--- a/tests/auto/other/other.pro
+++ b/tests/auto/other/other.pro
@@ -26,7 +26,7 @@ SUBDIRS=\
qtokenautomaton \
windowsmobile \
-contains(QT_CONFIG, no-widgets): SUBDIRS -= \
+!qtHaveModule(widgets): SUBDIRS -= \
baselineexample \
gestures \
headersclean \
diff --git a/tests/auto/sql/models/models.pro b/tests/auto/sql/models/models.pro
index c00ec2c935..2c3ae4ef0a 100644
--- a/tests/auto/sql/models/models.pro
+++ b/tests/auto/sql/models/models.pro
@@ -4,5 +4,5 @@ SUBDIRS=\
qsqlrelationaltablemodel \
qsqltablemodel \
-contains(QT_CONFIG, no-widgets): SUBDIRS -= \
+!qtHaveModule(widgets): SUBDIRS -= \
qsqlquerymodel
diff --git a/tests/auto/tools/moc/moc.pro b/tests/auto/tools/moc/moc.pro
index d91ae378da..772086d3c4 100644
--- a/tests/auto/tools/moc/moc.pro
+++ b/tests/auto/tools/moc/moc.pro
@@ -31,7 +31,7 @@ SOURCES += tst_moc.cpp
QT -= gui
QT += sql network testlib
-contains(QT_CONFIG, dbus){
+qtHaveModule(dbus) {
DEFINES += WITH_DBUS
QT += dbus
}
diff --git a/tests/auto/tools/tools.pro b/tests/auto/tools/tools.pro
index 4cc3d62a43..9b4d2ca22a 100644
--- a/tests/auto/tools/tools.pro
+++ b/tests/auto/tools/tools.pro
@@ -5,4 +5,4 @@ SUBDIRS=\
moc \
rcc \
-contains(QT_CONFIG, dbus):SUBDIRS += qdbuscpp2xml qdbusxml2cpp
+qtHaveModule(dbus): SUBDIRS += qdbuscpp2xml qdbusxml2cpp
diff --git a/tests/auto/widgets/widgets/qmdiarea/qmdiarea.pro b/tests/auto/widgets/widgets/qmdiarea/qmdiarea.pro
index 141392b251..cc2bcb3c30 100644
--- a/tests/auto/widgets/widgets/qmdiarea/qmdiarea.pro
+++ b/tests/auto/widgets/widgets/qmdiarea/qmdiarea.pro
@@ -6,7 +6,7 @@ QT += gui-private widgets testlib
INCLUDEPATH += .
SOURCES += tst_qmdiarea.cpp
DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII
-contains(QT_CONFIG, opengl):QT += opengl
+qtHaveModule(opengl): QT += opengl
mac {
LIBS += -framework Security
diff --git a/tests/benchmarks/benchmarks.pro b/tests/benchmarks/benchmarks.pro
index e685c3d7b2..5fd8ff6368 100644
--- a/tests/benchmarks/benchmarks.pro
+++ b/tests/benchmarks/benchmarks.pro
@@ -5,8 +5,8 @@ SUBDIRS = \
network \
sql \
-# removed-by-refactor contains(QT_CONFIG, opengl): SUBDIRS += opengl
-contains(QT_CONFIG, dbus): SUBDIRS += dbus
+# removed-by-refactor qtHaveModule(opengl): SUBDIRS += opengl
+qtHaveModule(dbus): SUBDIRS += dbus
check-trusted.CONFIG += recursive
QMAKE_EXTRA_TARGETS += check-trusted
diff --git a/tests/benchmarks/corelib/kernel/kernel.pro b/tests/benchmarks/corelib/kernel/kernel.pro
index a55135b74d..02eeeaa254 100644
--- a/tests/benchmarks/corelib/kernel/kernel.pro
+++ b/tests/benchmarks/corelib/kernel/kernel.pro
@@ -7,6 +7,6 @@ SUBDIRS = \
qvariant \
qcoreapplication
-isEmpty(QT.widgets.name): SUBDIRS -= \
+!qtHaveModule(widgets): SUBDIRS -= \
qmetaobject \
qobject
diff --git a/tests/benchmarks/corelib/tools/qregexp/qregexp.pro b/tests/benchmarks/corelib/tools/qregexp/qregexp.pro
index ef50a22d4d..74544519f3 100644
--- a/tests/benchmarks/corelib/tools/qregexp/qregexp.pro
+++ b/tests/benchmarks/corelib/tools/qregexp/qregexp.pro
@@ -6,7 +6,7 @@ CONFIG += release exceptions
SOURCES += main.cpp
RESOURCES += qregexp.qrc
-!isEmpty(QT.script.name):!pcre {
+qtHaveModule(script):!pcre {
DEFINES += HAVE_JSC
QT += script
}
diff --git a/tests/benchmarks/gui/animation/animation.pro b/tests/benchmarks/gui/animation/animation.pro
index 1c9a7c3c08..76c1a49e5c 100644
--- a/tests/benchmarks/gui/animation/animation.pro
+++ b/tests/benchmarks/gui/animation/animation.pro
@@ -1,2 +1,2 @@
TEMPLATE = subdirs
-!isEmpty(QT.widgets.name):SUBDIRS = qanimation
+qtHaveModule(widgets): SUBDIRS = qanimation
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/GraphicsViewBenchmark.pro b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/GraphicsViewBenchmark.pro
index b0bc021b0a..a6ed4b84fb 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/GraphicsViewBenchmark.pro
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/GraphicsViewBenchmark.pro
@@ -1,7 +1,7 @@
TEMPLATE = app
QT += svg testlib
-contains(QT_CONFIG, opengl):QT += opengl
+qtHaveModule(opengl): QT += opengl
HEADERS += widgets/gvbwidget.h \
widgets/abstractscrollarea.h \
diff --git a/tests/benchmarks/gui/graphicsview/graphicsview.pro b/tests/benchmarks/gui/graphicsview/graphicsview.pro
index f8ba062829..d89a00c4b9 100644
--- a/tests/benchmarks/gui/graphicsview/graphicsview.pro
+++ b/tests/benchmarks/gui/graphicsview/graphicsview.pro
@@ -8,7 +8,7 @@ SUBDIRS = \
qgraphicsview \
qgraphicswidget
-isEmpty(QT.widgets.name): SUBDIRS -= \
+!qtHaveModule(widgets): SUBDIRS -= \
qgraphicsanchorlayout \
qgraphicsitem \
qgraphicsscene \
diff --git a/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/chip.pro b/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/chip.pro
index 759216d46d..4047bad1ca 100644
--- a/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/chip.pro
+++ b/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/chip.pro
@@ -4,7 +4,7 @@ HEADERS += mainwindow.h view.h chip.h
SOURCES += main.cpp
SOURCES += mainwindow.cpp view.cpp chip.cpp
-contains(QT_CONFIG, opengl):QT += opengl
+qtHaveModule(opengl): QT += opengl
build_all:!build_pass {
CONFIG -= build_all
diff --git a/tests/benchmarks/gui/graphicsview/qgraphicsview/chiptester/chiptester.pri b/tests/benchmarks/gui/graphicsview/qgraphicsview/chiptester/chiptester.pri
index 8d02504b73..105117de30 100644
--- a/tests/benchmarks/gui/graphicsview/qgraphicsview/chiptester/chiptester.pri
+++ b/tests/benchmarks/gui/graphicsview/qgraphicsview/chiptester/chiptester.pri
@@ -10,4 +10,4 @@ RESOURCES += \
chiptester/images.qrc
QT += widgets
-contains(QT_CONFIG, opengl) QT += opengl
+qtHaveModule(opengl): QT += opengl
diff --git a/tests/benchmarks/gui/gui.pro b/tests/benchmarks/gui/gui.pro
index f4b84f0428..e943347938 100644
--- a/tests/benchmarks/gui/gui.pro
+++ b/tests/benchmarks/gui/gui.pro
@@ -17,5 +17,5 @@ TRUSTED_BENCHMARKS += \
include(../trusted-benchmarks.pri)
-isEmpty(QT.widgets.name): SUBDIRS -= \
+!qtHaveModule(widgets): SUBDIRS -= \
itemviews
diff --git a/tests/benchmarks/gui/image/image.pro b/tests/benchmarks/gui/image/image.pro
index fa26f3ec4c..2d5db35a73 100644
--- a/tests/benchmarks/gui/image/image.pro
+++ b/tests/benchmarks/gui/image/image.pro
@@ -6,5 +6,5 @@ SUBDIRS = \
qpixmap \
qpixmapcache
-isEmpty(QT.widgets.name): SUBDIRS -= \
+!qtHaveModule(widgets): SUBDIRS -= \
qimagereader
diff --git a/tests/benchmarks/gui/kernel/kernel.pro b/tests/benchmarks/gui/kernel/kernel.pro
index 303eff9759..cd7235cff8 100644
--- a/tests/benchmarks/gui/kernel/kernel.pro
+++ b/tests/benchmarks/gui/kernel/kernel.pro
@@ -1,4 +1,4 @@
TEMPLATE = subdirs
-!isEmpty(QT.widgets.name):SUBDIRS = \
+qtHaveModule(widgets): SUBDIRS = \
qapplication \
qwidget
diff --git a/tests/benchmarks/gui/painting/painting.pro b/tests/benchmarks/gui/painting/painting.pro
index e55222a2c2..b3fb34757c 100644
--- a/tests/benchmarks/gui/painting/painting.pro
+++ b/tests/benchmarks/gui/painting/painting.pro
@@ -6,7 +6,7 @@ SUBDIRS = \
qtracebench \
qtbench
-isEmpty(QT.widgets.name): SUBDIRS -= \
+!qtHaveModule(widgets): SUBDIRS -= \
qpainter \
qtracebench \
qtbench
diff --git a/tests/benchmarks/gui/styles/styles.pro b/tests/benchmarks/gui/styles/styles.pro
index 8930de127b..2c1d10b48c 100644
--- a/tests/benchmarks/gui/styles/styles.pro
+++ b/tests/benchmarks/gui/styles/styles.pro
@@ -1,3 +1,3 @@
TEMPLATE = subdirs
-!isEmpty(QT.widgets.name):SUBDIRS = \
+qtHaveModule(widgets): SUBDIRS = \
qstylesheetstyle
diff --git a/tests/manual/lance/lance.pro b/tests/manual/lance/lance.pro
index 6d1d7fa392..177ca0e40e 100644
--- a/tests/manual/lance/lance.pro
+++ b/tests/manual/lance/lance.pro
@@ -13,6 +13,6 @@ SOURCES += interactivewidget.cpp \
RESOURCES += icons.qrc \
$$LANCELOT_DIR/images.qrc
-contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2):QT += opengl
+qtHaveModule(opengl): QT += opengl
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0