diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-03-23 01:00:08 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2019-03-25 10:13:23 +0100 |
commit | a1e38651ce245edcd8628bc8e2aad7e83184066e (patch) | |
tree | 27d3a68ac4204975faa6d0d427970fb1013e0ed4 /tests/auto/quicktest/quicktestmainwithsetup/tst_quicktestmainwithsetup.cpp | |
parent | 3980ccf785462dc7b2cb53f72790638eb9e7b8c0 (diff) | |
parent | 42ed40cf0abd0155d6e6d1ef01faf9bded065588 (diff) |
Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
.qmake.conf
src/qmltest/quicktest.cpp
tests/auto/qml/qmlcachegen/qmlcachegen.pro
Change-Id: I70e96e8817d59647f876b8b77b30cdeede8f0662
Diffstat (limited to 'tests/auto/quicktest/quicktestmainwithsetup/tst_quicktestmainwithsetup.cpp')
-rw-r--r-- | tests/auto/quicktest/quicktestmainwithsetup/tst_quicktestmainwithsetup.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/quicktest/quicktestmainwithsetup/tst_quicktestmainwithsetup.cpp b/tests/auto/quicktest/quicktestmainwithsetup/tst_quicktestmainwithsetup.cpp index b0545d1a95..b5deeceac4 100644 --- a/tests/auto/quicktest/quicktestmainwithsetup/tst_quicktestmainwithsetup.cpp +++ b/tests/auto/quicktest/quicktestmainwithsetup/tst_quicktestmainwithsetup.cpp @@ -35,6 +35,14 @@ #include "../../shared/util.h" +class QmlRegisterTypeCppType : public QObject +{ + Q_OBJECT + +public: + QmlRegisterTypeCppType() {} +}; + class CustomTestSetup : public QObject { Q_OBJECT @@ -45,6 +53,12 @@ public: public slots: void qmlEngineAvailable(QQmlEngine *qmlEngine) { + // Test that modules are successfully imported by the TestCaseCollector that + // parses the QML files (but doesn't run them). For that to happen, qmlEngineAvailable() + // must be called before TestCaseCollector does its thing. + qmlRegisterType<QmlRegisterTypeCppType>("QmlRegisterTypeCppModule", 1, 0, "QmlRegisterTypeCppType"); + qmlEngine->addImportPath(QString::fromUtf8(QT_QMLTEST_DATADIR) + "/../imports"); + qmlEngine->rootContext()->setContextProperty("qmlEngineAvailableCalled", true); } }; |