diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2021-08-06 12:27:35 +0200 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2021-09-14 12:13:57 +0200 |
commit | 5ae7066e84e45721ce58e9d16e3c4da72aa51692 (patch) | |
tree | d0d710678c679477b0413744825b3c9ff0060569 /tests/auto/quick/qquickdroparea/tst_qquickdroparea.cpp | |
parent | b89322772234047849c4d44b592e1a555029bc7e (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
Change-Id: I0a2ab3976fdbff2e4414df7bdc0808f16453b80a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit e310dadef779b28845b41fb091634cd001cda9de)
Diffstat (limited to 'tests/auto/quick/qquickdroparea/tst_qquickdroparea.cpp')
-rw-r--r-- | tests/auto/quick/qquickdroparea/tst_qquickdroparea.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/auto/quick/qquickdroparea/tst_qquickdroparea.cpp b/tests/auto/quick/qquickdroparea/tst_qquickdroparea.cpp index 593f3a0efb..dbf090bfed 100644 --- a/tests/auto/quick/qquickdroparea/tst_qquickdroparea.cpp +++ b/tests/auto/quick/qquickdroparea/tst_qquickdroparea.cpp @@ -37,8 +37,8 @@ #include <qpa/qplatformdrag.h> #include <qpa/qwindowsysteminterface.h> -#include "../../shared/util.h" -#include "../shared/viewtestutil.h" +#include <QtQuickTestUtils/private/qmlutils_p.h> +#include <QtQuickTestUtils/private/viewtestutils_p.h> template <typename T> static T evaluate(QObject *scope, const QString &expression) { @@ -60,6 +60,10 @@ template <> void evaluate<void>(QObject *scope, const QString &expression) class tst_QQuickDropArea: public QQmlDataTest { Q_OBJECT + +public: + tst_QQuickDropArea(); + private slots: void containsDrag_internal(); void containsDrag_external(); @@ -81,6 +85,11 @@ private: QQmlEngine engine; }; +tst_QQuickDropArea::tst_QQuickDropArea() + : QQmlDataTest(QT_QMLTEST_DATADIR) +{ +} + void tst_QQuickDropArea::containsDrag_internal() { QQuickWindow window; |