aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquicktextinput
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2021-08-06 12:27:35 +0200
committerMitch Curtis <mitch.curtis@qt.io>2021-09-13 21:17:04 +0200
commite310dadef779b28845b41fb091634cd001cda9de (patch)
tree610be234e82cc53752f58521ae3beba4693ff78f /tests/auto/quick/qquicktextinput
parentde0c1c8a4c834dcc080d1b374186a82cd86921ca (diff)
Consolidate test helpers into private libraries
Previously each test would include and build sources from the shared folder. Now we make those sources a library, build it once, then have each test link to it instead. We also take the opportunity to move some helpers that qtquickcontrols2 had added into the quicktestutils library where it makes sense, and for the helpers that don't make sense to be there, move them into quickcontrolstestutils. We add the libraries to src/ so that they are internal modules built as part of Qt, rather than tests. That way we can use them in a standalone test outside of qtdeclarative. Task-number: QTBUG-95621 Pick-to: 6.2 Change-Id: I0a2ab3976fdbff2e4414df7bdc0808f16453b80a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/quick/qquicktextinput')
-rw-r--r--tests/auto/quick/qquicktextinput/CMakeLists.txt5
-rw-r--r--tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp9
2 files changed, 6 insertions, 8 deletions
diff --git a/tests/auto/quick/qquicktextinput/CMakeLists.txt b/tests/auto/quick/qquicktextinput/CMakeLists.txt
index 6e8d855a58..8f49477a30 100644
--- a/tests/auto/quick/qquicktextinput/CMakeLists.txt
+++ b/tests/auto/quick/qquicktextinput/CMakeLists.txt
@@ -12,17 +12,14 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquicktextinput
SOURCES
- ../../shared/testhttpserver.cpp ../../shared/testhttpserver.h
- ../../shared/util.cpp ../../shared/util.h
tst_qquicktextinput.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp b/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp
index 6a2516cf94..5e47476869 100644
--- a/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp
+++ b/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp
@@ -27,8 +27,8 @@
****************************************************************************/
#include <qtest.h>
#include <QtTest/QSignalSpy>
-#include "../../shared/util.h"
-#include "../../shared/testhttpserver.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/testhttpserver_p.h>
#include <private/qinputmethod_p.h>
#include <QtQml/qqmlengine.h>
#include <QtQml/qqmlexpression.h>
@@ -51,8 +51,8 @@
#endif
#include "qplatformdefs.h"
-#include "../../shared/platformquirks.h"
-#include "../../shared/platforminputcontext.h"
+#include <QtQuickTestUtils/private/platformquirks_p.h>
+#include <QtQuickTestUtils/private/platforminputcontext_p.h>
Q_DECLARE_METATYPE(QQuickTextInput::SelectionMode)
Q_DECLARE_METATYPE(QQuickTextInput::EchoMode)
@@ -302,6 +302,7 @@ void tst_qquicktextinput::cleanup()
}
tst_qquicktextinput::tst_qquicktextinput()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{
standard << "the quick brown fox jumped over the lazy dog"
<< "It's supercalifragisiticexpialidocious!"