From 9b407b68d1fc0abe08091aa7ca007fbf0f03fb89 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 21 Jan 2021 13:55:37 +0100 Subject: qmllint: Fix auto-importing of qmltypes from same directory Fixes: QTBUG-90513 Pick-to: 6.0 Change-Id: Ic39e72d6df20be30c61123a7f8091d70dbc2d924 Reviewed-by: Fabian Kosmale --- tests/auto/qml/qmllint/data/autoqmltypes/test.qml | 2 ++ tests/auto/qml/qmllint/data/autoqmltypes/test.qmltypes | 8 ++++++++ tests/auto/qml/qmllint/tst_qmllint.cpp | 17 +++++++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 tests/auto/qml/qmllint/data/autoqmltypes/test.qml create mode 100644 tests/auto/qml/qmllint/data/autoqmltypes/test.qmltypes (limited to 'tests') 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 3f674fb5cc..f5ef58940b 100644 --- a/tests/auto/qml/qmllint/tst_qmllint.cpp +++ b/tests/auto/qml/qmllint/tst_qmllint.cpp @@ -56,6 +56,8 @@ private Q_SLOTS: void qmltypes_data(); void qmltypes(); + void autoqmltypes(); + private: QString runQmllint(const QString &fileToLint, std::function handleResult, @@ -166,6 +168,21 @@ void TestQmllint::qmltypes() runQmllint(file, true); } +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("filename"); -- cgit v1.2.3