aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmllint
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2020-03-18 11:44:13 +0100
committerUlf Hermann <ulf.hermann@qt.io>2020-03-18 12:37:04 +0100
commit13caf26b29283b544edc2974fa1ea0481c63b435 (patch)
treec06077293de36f69c42b5e1a38844e2b8bbe07c4 /tests/auto/qml/qmllint
parent36fb7cf832e801a7b3718fa443ec2f1b83e0fea2 (diff)
parent869efe4a49c5286493d7f039325992725bcac6c3 (diff)
Merge remote-tracking branch 'origin/5.15' into dev
Conflicts: tools/qmllint/findunqualified.cpp Change-Id: I2593b5cc0db1d14e0c944aec4b88a80f46f5b0c1
Diffstat (limited to 'tests/auto/qml/qmllint')
-rw-r--r--tests/auto/qml/qmllint/data/ButtonLoader.qml10
-rw-r--r--tests/auto/qml/qmllint/data/Dialog.qml10
-rw-r--r--tests/auto/qml/qmllint/data/Drawer.qml5
-rw-r--r--tests/auto/qml/qmllint/data/Text.qml6
-rw-r--r--tests/auto/qml/qmllint/data/Things/plugins.qmltypes1
-rw-r--r--tests/auto/qml/qmllint/data/incompleteQmltypes.qml6
-rw-r--r--tests/auto/qml/qmllint/tst_qmllint.cpp7
7 files changed, 45 insertions, 0 deletions
diff --git a/tests/auto/qml/qmllint/data/ButtonLoader.qml b/tests/auto/qml/qmllint/data/ButtonLoader.qml
new file mode 100644
index 0000000000..2721614735
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/ButtonLoader.qml
@@ -0,0 +1,10 @@
+import QtQuick 2.12
+
+Item {
+ Text {
+ id: roundButton
+ Text {
+ font.pixelSize: roundButton.font.pixelSize * 0.5
+ }
+ }
+}
diff --git a/tests/auto/qml/qmllint/data/Dialog.qml b/tests/auto/qml/qmllint/data/Dialog.qml
new file mode 100644
index 0000000000..bde8eae18b
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/Dialog.qml
@@ -0,0 +1,10 @@
+import QtQuick 2.12
+
+Item {
+ id: control
+ property Text header
+ header: Text {
+ font.bold: true
+ padding: 12
+ }
+}
diff --git a/tests/auto/qml/qmllint/data/Drawer.qml b/tests/auto/qml/qmllint/data/Drawer.qml
new file mode 100644
index 0000000000..db1d785c6c
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/Drawer.qml
@@ -0,0 +1,5 @@
+import QtQml 2.12 as T
+
+T.QtObject {
+ objectName: T.Component.objectName
+}
diff --git a/tests/auto/qml/qmllint/data/Text.qml b/tests/auto/qml/qmllint/data/Text.qml
new file mode 100644
index 0000000000..130578d1e3
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/Text.qml
@@ -0,0 +1,6 @@
+import QtQuick 2.12 as T
+
+T.Text {
+ id: control
+ text: "'ello"
+}
diff --git a/tests/auto/qml/qmllint/data/Things/plugins.qmltypes b/tests/auto/qml/qmllint/data/Things/plugins.qmltypes
index 00cda191cc..9d81c21070 100644
--- a/tests/auto/qml/qmllint/data/Things/plugins.qmltypes
+++ b/tests/auto/qml/qmllint/data/Things/plugins.qmltypes
@@ -12,5 +12,6 @@ Module {
"CCC": 2
}
}
+ Property { name: "palette"; type: "QPalette" }
}
}
diff --git a/tests/auto/qml/qmllint/data/incompleteQmltypes.qml b/tests/auto/qml/qmllint/data/incompleteQmltypes.qml
new file mode 100644
index 0000000000..ab06bbd8b0
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/incompleteQmltypes.qml
@@ -0,0 +1,6 @@
+import Things 1.0
+
+SomethingEntirelyStrange {
+ id: self
+ property var a: self.palette.weDontKnowIt
+}
diff --git a/tests/auto/qml/qmllint/tst_qmllint.cpp b/tests/auto/qml/qmllint/tst_qmllint.cpp
index 1cd9f8b0d1..ed968d6623 100644
--- a/tests/auto/qml/qmllint/tst_qmllint.cpp
+++ b/tests/auto/qml/qmllint/tst_qmllint.cpp
@@ -160,6 +160,10 @@ void TestQmllint::dirtyQmlCode_data()
<< QStringLiteral("badTypeAssertion.qml")
<< QString("Warning: Property \"rrr\" not found on type \"Item\" at 5:39")
<< QString();
+ QTest::newRow("incompleteQmltypes")
+ << QStringLiteral("incompleteQmltypes.qml")
+ << QString("Warning: Type \"QPalette\" of member \"palette\" not found at 5:26")
+ << QString();
}
void TestQmllint::dirtyQmlCode()
@@ -192,6 +196,9 @@ void TestQmllint::cleanQmlCode_data()
QTest::newRow("goodParent") << QStringLiteral("goodParent.qml");
QTest::newRow("goodTypeAssertion") << QStringLiteral("goodTypeAssertion.qml");
QTest::newRow("AttachedProps") << QStringLiteral("AttachedProps.qml");
+ QTest::newRow("unknownBuiltinFont") << QStringLiteral("ButtonLoader.qml");
+ QTest::newRow("confusingImport") << QStringLiteral("Dialog.qml");
+ QTest::newRow("qualifiedAttached") << QStringLiteral("Drawer.qml");
}
void TestQmllint::cleanQmlCode()