diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2020-06-22 18:38:43 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2020-06-24 18:28:20 +0200 |
commit | 437b04e6ec5c767907a97af115d82b4cd7db93ae (patch) | |
tree | 6a6cb79149488e214a0068e69f9580ea3a5b572d /tests/auto/qml/qmllint/tst_qmllint.cpp | |
parent | 36df81b3bc6d721d5598d5163b0a9659de4a69ee (diff) |
qmllint: Properly process qmldir imports and dependencies
We don't want to pick the dependencies from the qmltypes files. Rather,
parse them directly from the qmldir. Do process versions, too.
Also, import explicitly given qmltypes files only once, and don't expose
QML types from dependencies as actual types. Hide them behind an
inaccessible prefix.
For the inaccessible prefix to work, we need to import the C++ class
names without the prefix. The prefix doesn't make sense for C++ names
anyway.
In addition, properly process version-less imports.
Change-Id: If582ad271db35351d219332c319571a814628fe0
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.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/auto/qml/qmllint/tst_qmllint.cpp b/tests/auto/qml/qmllint/tst_qmllint.cpp index d5912def6b..6d472842ca 100644 --- a/tests/auto/qml/qmllint/tst_qmllint.cpp +++ b/tests/auto/qml/qmllint/tst_qmllint.cpp @@ -183,6 +183,10 @@ void TestQmllint::dirtyQmlCode_data() << QStringLiteral("Cycle1.qml") << QString("Warning: Cycle2 is part of an inheritance cycle: Cycle2 -> Cycle3 -> Cycle1 -> Cycle2") << QString(); + QTest::newRow("badQmldirImportAndDepend") + << QStringLiteral("qmldirImportAndDepend/bad.qml") + << QString("warning: Item was not found. Did you add all import paths?") + << QString(); } void TestQmllint::dirtyQmlCode() @@ -224,6 +228,7 @@ void TestQmllint::cleanQmlCode_data() QTest::newRow("EnumAccess2") << QStringLiteral("EnumAccess2.qml"); QTest::newRow("ListProperty") << QStringLiteral("ListProperty.qml"); QTest::newRow("AttachedType") << QStringLiteral("AttachedType.qml"); + QTest::newRow("qmldirImportAndDepend") << QStringLiteral("qmldirImportAndDepend/good.qml"); } void TestQmllint::cleanQmlCode() |