aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2024-12-19 14:52:09 +0100
committerUlf Hermann <ulf.hermann@qt.io>2025-01-06 17:27:47 +0100
commit735556d19d7bd67a1a9729586743e1c8b86de257 (patch)
treefd38b43fc17fbfbb723560e38d871f1b3292efd0 /tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
parent52b5aaaabbbdef3da9fd9ffc2cf3fb947196ab24 (diff)
QtQml: Accept .js and .mjs files in directory-listing qmldirs
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 <olivier.decanniere@qt.io>
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp')
-rw-r--r--tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp12
1 files changed, 12 insertions, 0 deletions
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<QObject> object(component.create());
+ QVERIFY(!object.isNull());
+}
+
void tst_QmlCppCodegen::consoleObject()
{
QQmlEngine engine;