summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2017-09-13 18:42:23 +0200
committerMichal Klocek <michal.klocek@qt.io>2017-09-19 07:51:20 +0000
commitd8f18e2b918e2f7c8149d3e6cd1510b27bde7dfd (patch)
treefab2058afa678909dd06f831b79fb68316cdb40a
parentaaac5fe1f9a1be81b919642e6272967f86fef1a5 (diff)
Add testsupport to new configure system
Change-Id: I123ce22ea3a3d8b7b80c67fa322cb817d924f2e0 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
-rw-r--r--configure.json5
-rw-r--r--configure.pri5
-rw-r--r--mkspecs/features/functions.prf12
-rw-r--r--src/src.pro2
-rw-r--r--src/webengine/webengine.pro5
-rw-r--r--tests/auto/quick/qmltests/qmltests.pro4
-rw-r--r--tests/auto/quick/quick.pro5
-rw-r--r--tests/auto/quick/shared/util.h2
-rw-r--r--tests/auto/quick/tests.pri5
9 files changed, 26 insertions, 19 deletions
diff --git a/configure.json b/configure.json
index 726d151c7..f2cd78343 100644
--- a/configure.json
+++ b/configure.json
@@ -444,6 +444,11 @@
"label": "UI Delegates",
"output": [ "privateFeature" ]
},
+ "testsupport": {
+ "label": "Test Support",
+ "autoDetect": "config.private_tests || call.isTestsInBuildParts",
+ "output": [ "privateFeature" ]
+ },
"webrtc": {
"label": "WebRTC",
"purpose": "Provides WebRTC support.",
diff --git a/configure.pri b/configure.pri
index c88d4964b..0b6f9fd1b 100644
--- a/configure.pri
+++ b/configure.pri
@@ -245,3 +245,8 @@ defineTest(isSanitizerLinuxClangVersionSupported) {
qtLog("Using Clang version $${QT_CLANG_MAJOR_VERSION}.$${QT_CLANG_MINOR_VERSION}, but at least Clang version 3.7 is required to build a sanitizer-enabled Qt WebEngine.")
return(false)
}
+
+defineReplace(qtConfFunc_isTestsInBuildParts) {
+ contains(QT_BUILD_PARTS, tests): return(true)
+ return(false)
+}
diff --git a/mkspecs/features/functions.prf b/mkspecs/features/functions.prf
index cdb826d98..0074a27b0 100644
--- a/mkspecs/features/functions.prf
+++ b/mkspecs/features/functions.prf
@@ -116,18 +116,6 @@ defineReplace(gnOS) {
return(unknown)
}
-defineTest(isDeveloperBuild) {
- qtConfig(private_tests): return(true) # enabled for developer-build
- return(false)
-}
-
-defineTest(isQMLTestSupportApiEnabled) {
- isDeveloperBuild(): return(true)
- contains(QT_BUILD_PARTS, tests): return(true)
- contains(WEBENGINE_CONFIG, testsupport): return(true)
- return(false)
-}
-
defineTest(skipBuild) {
skipBuildReason = "$$skipBuildReason $${EOL}$$1"
export(skipBuildReason)
diff --git a/src/src.pro b/src/src.pro
index d994fc0e9..fabead2a0 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -26,7 +26,7 @@ use?(spellchecker):!use?(native_spellchecker):!cross_compile {
qwebengine_convert_dict.depends = core
}
-isQMLTestSupportApiEnabled() {
+qtConfig(testsupport) {
webengine_testsupport_plugin.subdir = webengine/plugin/testsupport
webengine_testsupport_plugin.target = sub-webengine-testsupport-plugin
webengine_testsupport_plugin.depends = webengine
diff --git a/src/webengine/webengine.pro b/src/webengine/webengine.pro
index f4bc65edb..ac2727580 100644
--- a/src/webengine/webengine.pro
+++ b/src/webengine/webengine.pro
@@ -1,3 +1,6 @@
+include($$QTWEBENGINE_OUT_ROOT/qtwebengine-config.pri)
+QT_FOR_CONFIG += webengine-private
+
TARGET = QtWebEngine
# For our export macros
@@ -55,7 +58,7 @@ HEADERS = \
render_widget_host_view_qt_delegate_quickwindow.h \
ui_delegates_manager.h
-isQMLTestSupportApiEnabled() {
+qtConfig(testsupport) {
QT += testlib
SOURCES += api/qquickwebenginetestsupport.cpp
diff --git a/tests/auto/quick/qmltests/qmltests.pro b/tests/auto/quick/qmltests/qmltests.pro
index ceb246dc0..9530e115c 100644
--- a/tests/auto/quick/qmltests/qmltests.pro
+++ b/tests/auto/quick/qmltests/qmltests.pro
@@ -100,7 +100,7 @@ OTHER_FILES += \
load(qt_build_paths)
DEFINES += QUICK_TEST_SOURCE_DIR=\\\"$$re_escape($$PWD$${QMAKE_DIR_SEP}data)\\\"
-!isQMLTestSupportApiEnabled() {
+!qtConfig(testsupport) {
PLUGIN_EXTENSION = .so
PLUGIN_PREFIX = lib
osx: PLUGIN_PREFIX = .dylib
@@ -115,6 +115,6 @@ DEFINES += QUICK_TEST_SOURCE_DIR=\\\"$$re_escape($$PWD$${QMAKE_DIR_SEP}data)\\\"
warning("QML Test Support API is disabled. This means some QML tests that use Test Support API will fail.")
warning("Use the following command to build Test Support module and rebuild WebEngineView API:")
- warning("cd $$BUILD_DIR && qmake WEBENGINE_CONFIG+=testsupport -r $$shell_path($$SRC_DIR/qtwebengine.pro) && make -C $$shell_path($$BUILD_DIR/src/webengine) clean && make")
+ warning("cd $$BUILD_DIR && qmake -r $$shell_path($$SRC_DIR/qtwebengine.pro -- --feature-testsupport=yes) && make -C $$shell_path($$BUILD_DIR/src/webengine) clean && make")
warning("After performing the command above make sure QML module \"QtWebEngine.testsupport\" is deployed at $$TESTSUPPORT_MODULE")
}
diff --git a/tests/auto/quick/quick.pro b/tests/auto/quick/quick.pro
index 8733ccac1..75217c1ec 100644
--- a/tests/auto/quick/quick.pro
+++ b/tests/auto/quick/quick.pro
@@ -1,3 +1,6 @@
+include($$QTWEBENGINE_OUT_ROOT/qtwebengine-config.pri)
+QT_FOR_CONFIG += webengine-private
+
TEMPLATE = subdirs
SUBDIRS += \
@@ -6,7 +9,7 @@ SUBDIRS += \
qquickwebenginedefaultsurfaceformat \
qquickwebengineview
-isQMLTestSupportApiEnabled() {
+qtConfig(testsupport) {
SUBDIRS += \
qmltests \
qquickwebengineviewgraphics
diff --git a/tests/auto/quick/shared/util.h b/tests/auto/quick/shared/util.h
index 98f19bd49..16456601f 100644
--- a/tests/auto/quick/shared/util.h
+++ b/tests/auto/quick/shared/util.h
@@ -115,7 +115,7 @@ inline bool waitForViewportReady(QQuickWebEngineView *webEngineView, int timeout
Q_UNUSED(timeout)
qFatal("Test Support API is disabled. The result is not reliable.\
Use the following command to build Test Support module and rebuild WebEngineView API:\
- qmake -r WEBENGINE_CONFIG+=testsupport && make");
+ qmake -r -- --feature-testsupport=yes && make");
return false;
#endif
}
diff --git a/tests/auto/quick/tests.pri b/tests/auto/quick/tests.pri
index e00537b9e..15f6517a4 100644
--- a/tests/auto/quick/tests.pri
+++ b/tests/auto/quick/tests.pri
@@ -1,3 +1,6 @@
+include($$QTWEBENGINE_OUT_ROOT/qtwebengine-config.pri)
+QT_FOR_CONFIG += webengine-private
+
TEMPLATE = app
CONFIG += testcase
@@ -16,7 +19,7 @@ QT += testlib network quick webengine
# This define is used by some tests to look up resources in the source tree
DEFINES += TESTS_SOURCE_DIR=\\\"$$PWD/\\\"
-isQMLTestSupportApiEnabled() {
+qtConfig(testsupport) {
DEFINES += ENABLE_QML_TESTSUPPORT_API
}