diff options
-rw-r--r-- | src/imports/tooling/Component.qml | 1 | ||||
-rw-r--r-- | tests/auto/qml/qmllint/tst_qmllint.cpp | 23 |
2 files changed, 23 insertions, 1 deletions
diff --git a/src/imports/tooling/Component.qml b/src/imports/tooling/Component.qml index 5f628962a7..d87e613907 100644 --- a/src/imports/tooling/Component.qml +++ b/src/imports/tooling/Component.qml @@ -48,6 +48,7 @@ QtObject { property var exports: [] property var exportMetaObjectRevisions: [] property string attachedType + property string valueType property bool isSingleton: false property bool isCreatable: name.length > 0 property bool isComposite: false 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; |