From 735556d19d7bd67a1a9729586743e1c8b86de257 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 19 Dec 2024 14:52:09 +0100 Subject: QtQml: Accept .js and .mjs files in directory-listing qmldirs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since it's documented like this, we should actually allow it. Pick-to: 6.9 6.8 6.5 Task-number: QTBUG-132118 Change-Id: I2192f040b8fdf545b8dbb0687b6e618a9858ed07 Reviewed-by: Olivier De Cannière --- tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp') diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp index 1a4433b793..823f79c269 100644 --- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp +++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp @@ -30,6 +30,7 @@ using namespace Qt::StringLiterals; Q_IMPORT_QML_PLUGIN(TestTypesPlugin) +Q_IMPORT_QML_PLUGIN(ConfusedPlugin) class tst_QmlCppCodegen : public QObject { @@ -71,6 +72,7 @@ private slots: void componentReturnType(); void compositeSingleton(); void compositeTypeMethod(); + void confusedModule(); void consoleObject(); void consoleTrace(); void construct(); @@ -1111,6 +1113,16 @@ void tst_QmlCppCodegen::compositeTypeMethod() QTRY_VERIFY(spy.size() > 0); } +void tst_QmlCppCodegen::confusedModule() +{ + QQmlEngine engine; + QQmlComponent component(&engine, QUrl(u"qrc:/qt/qml/Confused/Main.qml"_s)); + QVERIFY2(!component.isError(), component.errorString().toUtf8()); + QTest::ignoreMessage(QtDebugMsg, "Hello from Test"); + QScopedPointer object(component.create()); + QVERIFY(!object.isNull()); +} + void tst_QmlCppCodegen::consoleObject() { QQmlEngine engine; -- cgit v1.2.3