diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2021-01-21 13:55:37 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2021-01-22 09:19:28 +0100 |
commit | adece5d3bb5940d7bb9f7afe49ed4ce10ee60c1b (patch) | |
tree | d080c1d34267d83be28176e37777e0a49961ad82 /tests | |
parent | 2e07bf77bb9c08cc30a7ab29ae08b1523bbc1052 (diff) |
qmllint: Fix auto-importing of qmltypes from same directory
Fixes: QTBUG-90513
Change-Id: Ic39e72d6df20be30c61123a7f8091d70dbc2d924
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 9b407b68d1fc0abe08091aa7ca007fbf0f03fb89)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qml/qmllint/data/autoqmltypes/test.qml | 2 | ||||
-rw-r--r-- | tests/auto/qml/qmllint/data/autoqmltypes/test.qmltypes | 8 | ||||
-rw-r--r-- | tests/auto/qml/qmllint/tst_qmllint.cpp | 17 |
3 files changed, 27 insertions, 0 deletions
diff --git a/tests/auto/qml/qmllint/data/autoqmltypes/test.qml b/tests/auto/qml/qmllint/data/autoqmltypes/test.qml new file mode 100644 index 0000000000..6f98f00f93 --- /dev/null +++ b/tests/auto/qml/qmllint/data/autoqmltypes/test.qml @@ -0,0 +1,2 @@ +import TestTest +Foo {} diff --git a/tests/auto/qml/qmllint/data/autoqmltypes/test.qmltypes b/tests/auto/qml/qmllint/data/autoqmltypes/test.qmltypes new file mode 100644 index 0000000000..1874bdda61 --- /dev/null +++ b/tests/auto/qml/qmllint/data/autoqmltypes/test.qmltypes @@ -0,0 +1,8 @@ +import QtQuick.tooling 1.2 +Module { + Component { + name: "Foo" + exports: ["TestTest/Foo 1.0"] + exportMetaObjectRevisions: [256] + } +} diff --git a/tests/auto/qml/qmllint/tst_qmllint.cpp b/tests/auto/qml/qmllint/tst_qmllint.cpp index 7ad5ee136e..2a6ff48baf 100644 --- a/tests/auto/qml/qmllint/tst_qmllint.cpp +++ b/tests/auto/qml/qmllint/tst_qmllint.cpp @@ -53,6 +53,8 @@ private Q_SLOTS: void directoryPassedAsQmlTypesFile(); void oldQmltypes(); + void autoqmltypes(); + private: QString runQmllint(const QString &fileToLint, std::function<void(QProcess &)> handleResult, @@ -146,6 +148,21 @@ void TestQmllint::oldQmltypes() QVERIFY(errors.contains(QStringLiteral("Revision 0 corresponds to version 0.0; it should be 1.0."))); } +void TestQmllint::autoqmltypes() +{ + QProcess process; + process.setWorkingDirectory(testFile("autoqmltypes")); + process.start(m_qmllintPath, { QStringLiteral("test.qml") }); + + process.waitForFinished(); + + QCOMPARE(process.exitStatus(), QProcess::NormalExit); + QCOMPARE(process.exitCode(), 0); + + QVERIFY(process.readAllStandardError().isEmpty()); + QVERIFY(process.readAllStandardOutput().isEmpty()); +} + void TestQmllint::dirtyQmlCode_data() { QTest::addColumn<QString>("filename"); |