aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2021-02-18 10:32:53 +0100
committerUlf Hermann <ulf.hermann@qt.io>2021-02-19 13:14:16 +0100
commite59957d2c46bb52ab5fefeb91ace7e192558373a (patch)
tree30d00552dff87d66a376df7f35706c7e7ffd52ab /tests/auto/qml
parent33937b28180d8e653e47b9e34c03972553976c6f (diff)
qmllint: Resolve attached property scopes
Previously, all attached property scopes were just ignored. Task-number: QTBUG-84369 Change-Id: I324becf92402eacea9d150e6e51359edae562dde Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit f34ecc8f99522b69d1aaa3d5d233add9ed9b6da9)
Diffstat (limited to 'tests/auto/qml')
-rw-r--r--tests/auto/qml/qmllint/data/attached.qml5
-rw-r--r--tests/auto/qml/qmllint/data/badAttached.qml5
-rw-r--r--tests/auto/qml/qmllint/tst_qmllint.cpp5
3 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/qml/qmllint/data/attached.qml b/tests/auto/qml/qmllint/data/attached.qml
new file mode 100644
index 0000000000..0fcf3cacc6
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/attached.qml
@@ -0,0 +1,5 @@
+import QtQml
+
+QtObject {
+ Component.objectName: "foobar"
+}
diff --git a/tests/auto/qml/qmllint/data/badAttached.qml b/tests/auto/qml/qmllint/data/badAttached.qml
new file mode 100644
index 0000000000..93d64ec8ae
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/badAttached.qml
@@ -0,0 +1,5 @@
+import QtQml
+
+QtObject {
+ WrongAttached.foo: "bar"
+}
diff --git a/tests/auto/qml/qmllint/tst_qmllint.cpp b/tests/auto/qml/qmllint/tst_qmllint.cpp
index c8e0dd2db3..a86c202790 100644
--- a/tests/auto/qml/qmllint/tst_qmllint.cpp
+++ b/tests/auto/qml/qmllint/tst_qmllint.cpp
@@ -302,6 +302,10 @@ void TestQmllint::dirtyQmlCode_data()
<< QStringLiteral("onAssignment.qml")
<< QStringLiteral("Property \"loops\" not found on type \"bool\"")
<< QString();
+ QTest::newRow("BadAttached")
+ << QStringLiteral("badAttached.qml")
+ << QStringLiteral("unknown attached property scope WrongAttached.")
+ << QString();
}
void TestQmllint::dirtyQmlCode()
@@ -366,6 +370,7 @@ void TestQmllint::cleanQmlCode_data()
QTest::newRow("segFault") << QStringLiteral("SegFault.qml");
QTest::newRow("grouped scope failure") << QStringLiteral("groupedScope.qml");
QTest::newRow("layouts depends quick") << QStringLiteral("layouts.qml");
+ QTest::newRow("attached") << QStringLiteral("attached.qml");
}
void TestQmllint::cleanQmlCode()