diff options
Diffstat (limited to 'tests/auto/qml/qmllint/tst_qmllint.cpp')
-rw-r--r-- | tests/auto/qml/qmllint/tst_qmllint.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/tests/auto/qml/qmllint/tst_qmllint.cpp b/tests/auto/qml/qmllint/tst_qmllint.cpp index 7e21c8d437..3f674fb5cc 100644 --- a/tests/auto/qml/qmllint/tst_qmllint.cpp +++ b/tests/auto/qml/qmllint/tst_qmllint.cpp @@ -53,6 +53,9 @@ private Q_SLOTS: void directoryPassedAsQmlTypesFile(); void oldQmltypes(); + void qmltypes_data(); + void qmltypes(); + private: QString runQmllint(const QString &fileToLint, std::function<void(QProcess &)> handleResult, @@ -146,6 +149,23 @@ void TestQmllint::oldQmltypes() QVERIFY(errors.contains(QStringLiteral("Revision 0 corresponds to version 0.0; it should be 1.0."))); } +void TestQmllint::qmltypes_data() +{ + QTest::addColumn<QString>("file"); + + const QString importsPath = QLibraryInfo::path(QLibraryInfo::Qml2ImportsPath); + QDirIterator it(importsPath, { "*.qmltypes" }, + QDir::Files, QDirIterator::Subdirectories); + while (it.hasNext()) + QTest::addRow("%s", qPrintable(it.next().mid(importsPath.length()))) << it.filePath(); +} + +void TestQmllint::qmltypes() +{ + QFETCH(QString, file); + runQmllint(file, true); +} + void TestQmllint::dirtyQmlCode_data() { QTest::addColumn<QString>("filename"); @@ -306,7 +326,8 @@ QString TestQmllint::runQmllint(const QString &fileToLint, { auto qmlImportDir = QLibraryInfo::path(QLibraryInfo::Qml2ImportsPath); QStringList args; - args << testFile(fileToLint) + + args << (QFileInfo(fileToLint).isAbsolute() ? fileToLint : testFile(fileToLint)) << QStringLiteral("-I") << qmlImportDir << QStringLiteral("-I") << dataDirectory(); args << extraArgs; |