aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml
diff options
context:
space:
mode:
authorMaximilian Goldstein <max.goldstein@qt.io>2021-04-19 14:44:33 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-04-19 16:58:33 +0000
commitd54bf8c57a85bf29c0b795e417adb16b7f900cee (patch)
tree15d26be8ecd92fe7fa77ad0f642f39688b683487 /tests/auto/qml
parent45813ec8027a90e795c2c71b5da7929b038193e2 (diff)
qqmlirbuilder: Fix treating parser warnings as errros
Previously parser warnings (i.e. inline components having lowercase names) were treated as errors. Because these were not handled properly this also resulted in the QQmlComponent with the warning never becoming ready. This resulted applications hanging instead of terminating. Change-Id: Ia5ad3b54edc1b94dd94d0bf771c3494691abec71 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit e49be8d2b1b7acb310873a63f46980d1f0296f95) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests/auto/qml')
-rw-r--r--tests/auto/qml/qqmllanguage/data/hangOnWarning.qml3
-rw-r--r--tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp12
2 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmllanguage/data/hangOnWarning.qml b/tests/auto/qml/qqmllanguage/data/hangOnWarning.qml
new file mode 100644
index 0000000000..51943c3839
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/hangOnWarning.qml
@@ -0,0 +1,3 @@
+import QtQml 2.15
+
+QtObject["foobar"] {}
diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
index 7dbe844ea9..7b220f2de3 100644
--- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
+++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
@@ -349,6 +349,8 @@ private slots:
void invalidInlineComponent();
+ void hangOnWarning();
+
private:
QQmlEngine engine;
QStringList defaultImportPathList;
@@ -6154,6 +6156,16 @@ void tst_qqmllanguage::bareInlineComponent()
QVERIFY(tab1Found);
}
+void tst_qqmllanguage::hangOnWarning()
+{
+ QTest::ignoreMessage(QtWarningMsg,
+ qPrintable(QStringLiteral("%1:3 : Ignored annotation")
+ .arg(testFileUrl("hangOnWarning.qml").toString())));
+ QQmlComponent component(&engine, testFileUrl("hangOnWarning.qml"));
+ QScopedPointer<QObject> object(component.create());
+ QVERIFY(object != nullptr);
+}
+
QTEST_MAIN(tst_qqmllanguage)
#include "tst_qqmllanguage.moc"