aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmllint/tst_qmllint.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2019-11-08 14:48:32 +0100
committerUlf Hermann <ulf.hermann@qt.io>2020-01-13 16:54:08 +0100
commitd0b2a3b5eb4021fb19b634e550cbc6f6664ad775 (patch)
tree4fd37a9c1993451554d0a694bcfaf0cfc5c07a1e /tests/auto/qml/qmllint/tst_qmllint.cpp
parentd2b3cb0a8794dacbe929ae67447d16377efbccd7 (diff)
qmllint: Analyze member access
We can analyze access to many field member expressions and figure out if the accessed members exist. There are limits to this, of course. Generic JavaScript values are out of scope here. Change-Id: Id2e7613e56f06555cc3a2ba1c51683d9ea0bb84b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/qml/qmllint/tst_qmllint.cpp')
-rw-r--r--tests/auto/qml/qmllint/tst_qmllint.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/auto/qml/qmllint/tst_qmllint.cpp b/tests/auto/qml/qmllint/tst_qmllint.cpp
index d31fd9309b..d63017e5b1 100644
--- a/tests/auto/qml/qmllint/tst_qmllint.cpp
+++ b/tests/auto/qml/qmllint/tst_qmllint.cpp
@@ -109,7 +109,7 @@ void TestQmllint::testUnqualified_data()
void TestQmllint::testUnqualifiedNoSpuriousParentWarning()
{
- const QString unknownNotFound = runQmllint("spuriousParentWarning.qml", true);
+ const QString unknownNotFound = runQmllint("spuriousParentWarning.qml", false);
QVERIFY(unknownNotFound.contains(
QStringLiteral("warning: Unknown was not found. Did you add all import paths?")));
}
@@ -132,6 +132,14 @@ void TestQmllint::dirtyQmlCode_data()
<< QStringLiteral("AutomatchedSignalHandler.qml")
<< QString("Warning: unqualified access at 12:36")
<< QStringLiteral("no matching signal found");
+ QTest::newRow("MemberNotFound")
+ << QStringLiteral("memberNotFound.qml")
+ << QString("Warning: Property \"foo\" not found on type \"QtObject\" at 6:31")
+ << QString();
+ QTest::newRow("UnknownJavascriptMethd")
+ << QStringLiteral("unknownJavascriptMethod.qml")
+ << QString("Warning: Property \"foo2\" not found on type \"Methods\" at 5:25")
+ << QString();
}
void TestQmllint::dirtyQmlCode()