diff options
-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 | ||||
-rw-r--r-- | tools/qmllint/main.cpp | 4 |
4 files changed, 30 insertions, 1 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 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<void(QProcess &)> 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<QString>("filename"); diff --git a/tools/qmllint/main.cpp b/tools/qmllint/main.cpp index a877b20335..428925c2e8 100644 --- a/tools/qmllint/main.cpp +++ b/tools/qmllint/main.cpp @@ -171,8 +171,10 @@ int main(int argv, char *argc[]) } else { // If none are given explicitly, use the qmltypes files from the current directory. QDirIterator it(".", {"*.qmltypes"}, QDir::Files); - while (it.hasNext()) + while (it.hasNext()) { + it.next(); qmltypesFiles.append(it.fileInfo().absoluteFilePath()); + } } #else |