diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2020-10-06 12:29:00 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2020-10-07 11:25:40 +0000 |
commit | 3633047d812559fc91d6f6324c4677bd886ef7fd (patch) | |
tree | f39250b047dda6a53ffd3c01c24daa80355b0b03 /tests/auto/qml/qmllint | |
parent | 26fa3d2cef8ec55dfb276e999d41e01e9a846093 (diff) |
QmlCompiler: Use the declared typeinfos rather than the default
... and produce a warning when encountering the default.
This shows us that the qmake build omits some typeinfo entries from
common modules. Add those.
Change-Id: I1c7e87e8a54ef24a6076090e6051eb1c03c09b2a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/qml/qmllint')
-rw-r--r-- | tests/auto/qml/qmllint/data/OldQmltypes/plugins.qmltypes | 8 | ||||
-rw-r--r-- | tests/auto/qml/qmllint/data/OldQmltypes/qmldir | 2 | ||||
-rw-r--r-- | tests/auto/qml/qmllint/data/Things/qmldir | 2 | ||||
-rw-r--r-- | tests/auto/qml/qmllint/data/oldQmltypes.qml | 4 | ||||
-rw-r--r-- | tests/auto/qml/qmllint/tst_qmllint.cpp | 7 |
5 files changed, 22 insertions, 1 deletions
diff --git a/tests/auto/qml/qmllint/data/OldQmltypes/plugins.qmltypes b/tests/auto/qml/qmllint/data/OldQmltypes/plugins.qmltypes new file mode 100644 index 0000000000..eab91f6723 --- /dev/null +++ b/tests/auto/qml/qmllint/data/OldQmltypes/plugins.qmltypes @@ -0,0 +1,8 @@ +import QtQuick.tooling 1.2 +Module { + Component { + name: "Frame" + exports: ["OldQmltypes/Frame 1.0"] + exportMetaObjectRevisions: [0] + } +} diff --git a/tests/auto/qml/qmllint/data/OldQmltypes/qmldir b/tests/auto/qml/qmllint/data/OldQmltypes/qmldir new file mode 100644 index 0000000000..374a533bbc --- /dev/null +++ b/tests/auto/qml/qmllint/data/OldQmltypes/qmldir @@ -0,0 +1,2 @@ +module OldQmltypes +plugin foobar diff --git a/tests/auto/qml/qmllint/data/Things/qmldir b/tests/auto/qml/qmllint/data/Things/qmldir index d91d4afc92..554f75d313 100644 --- a/tests/auto/qml/qmllint/data/Things/qmldir +++ b/tests/auto/qml/qmllint/data/Things/qmldir @@ -1,5 +1,5 @@ module Things Something 1.0 SomethingElse.qml -plugin doesNotExistPlugin +typeinfo plugins.qmltypes depends QtQuick 2.0 import QtQml diff --git a/tests/auto/qml/qmllint/data/oldQmltypes.qml b/tests/auto/qml/qmllint/data/oldQmltypes.qml new file mode 100644 index 0000000000..f33d4d90fe --- /dev/null +++ b/tests/auto/qml/qmllint/data/oldQmltypes.qml @@ -0,0 +1,4 @@ +import OldQmltypes 1.0 + +Frame { +} diff --git a/tests/auto/qml/qmllint/tst_qmllint.cpp b/tests/auto/qml/qmllint/tst_qmllint.cpp index 75938161b5..1b77e941ab 100644 --- a/tests/auto/qml/qmllint/tst_qmllint.cpp +++ b/tests/auto/qml/qmllint/tst_qmllint.cpp @@ -51,6 +51,7 @@ private Q_SLOTS: void testUnknownCausesFail(); void directoryPassedAsQmlTypesFile(); + void oldQmltypes(); private: QString runQmllint(const QString &fileToLint, @@ -133,6 +134,12 @@ void TestQmllint::directoryPassedAsQmlTypesFile() "Expected error to contain \"%1\", but it didn't: %2").arg(expectedError, errorMessages))); } +void TestQmllint::oldQmltypes() +{ + const QString errors = runQmllint("oldQmltypes.qml", true); + QVERIFY(errors.contains(QStringLiteral("Warning: typeinfo not declared in qmldir file"))); +} + void TestQmllint::dirtyQmlCode_data() { QTest::addColumn<QString>("filename"); |