diff options
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp')
| -rw-r--r-- | tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp index 82cc1fe954..22e04e0df3 100644 --- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp +++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp @@ -162,6 +162,8 @@ private slots: void methodOnListLookup(); void methods(); void modulePrefix(); + void multiDirectory_data(); + void multiDirectory(); void multiForeign(); void multiLookup(); void multipleCtors(); @@ -2608,13 +2610,13 @@ void tst_QmlCppCodegen::invisibleSingleton() qmlClearTypeRegistrations(); QQmlEngine engine; - const QUrl copy(u"qrc:/qt/qml/TestTypes/hidden/Main.qml"_s); + const QUrl copy(u"qrc:/qt/qml/HiddenTestTypes/hidden/Main.qml"_s); QQmlComponent c(&engine, copy); QVERIFY2(c.isReady(), qPrintable(c.errorString())); QTest::ignoreMessage( QtWarningMsg, - "qrc:/qt/qml/TestTypes/hidden/Main.qml:4:5: " + "qrc:/qt/qml/HiddenTestTypes/hidden/Main.qml:4:5: " "Unable to assign [undefined] to QColor"); QScopedPointer<QObject> o(c.create()); QVERIFY(!o.isNull()); @@ -3293,6 +3295,29 @@ void tst_QmlCppCodegen::modulePrefix() QCOMPARE(rootObject->property("baz").toString(), QStringLiteral("ItIsTheSingleton")); } +void tst_QmlCppCodegen::multiDirectory_data() +{ + QTest::addColumn<QUrl>("url"); + QTest::addRow("from qt_add_qml_module") + << QUrl(u"qrc:/qt/qml/TestTypes/extra/extra.qml"_s); +#ifndef VERY_OLD_CMAKE + QTest::addRow("from qt_target_qml_sources") + << QUrl(u"qrc:/qt/qml/TestTypes/extra2/extra.qml"_s); +#endif +} + +void tst_QmlCppCodegen::multiDirectory() +{ + QFETCH(QUrl, url); + QQmlEngine engine; + QQmlComponent component(&engine, url); + QVERIFY2(component.isReady(), qPrintable(component.errorString())); + QScopedPointer<QObject> rootObject(component.create()); + QVERIFY(rootObject); + + QCOMPARE(rootObject->property("r").value<QRectF>(), QRectF(4, 6, 8, 10)); +} + void tst_QmlCppCodegen::multiForeign() { QQmlEngine engine; |
