diff --git a/tests/auto/qml/qmllint/data/settings/bare/.qmllint.ini b/tests/auto/qml/qmllint/data/settings/bare/.qmllint.ini index e419c37f3a..2dc9ff658c 100644 --- a/tests/auto/qml/qmllint/data/settings/bare/.qmllint.ini +++ b/tests/auto/qml/qmllint/data/settings/bare/.qmllint.ini @@ -1,2 +1,2 @@ -[Foo] +[General] DisableDefaultImports=true diff --git a/tests/auto/qml/qmllint/data/settings/qmlimports/.qmllint.ini b/tests/auto/qml/qmllint/data/settings/qmlimports/.qmllint.ini new file mode 100644 index 0000000000..c2f9d81743 --- /dev/null +++ b/tests/auto/qml/qmllint/data/settings/qmlimports/.qmllint.ini @@ -0,0 +1,2 @@ +[General] +AdditionalQmlImportPaths=subdir diff --git a/tests/auto/qml/qmllint/data/settings/qmlimports/qmlimports.qml b/tests/auto/qml/qmllint/data/settings/qmlimports/qmlimports.qml new file mode 100644 index 0000000000..221ddff254 --- /dev/null +++ b/tests/auto/qml/qmllint/data/settings/qmlimports/qmlimports.qml @@ -0,0 +1,3 @@ +import Custom + +Thing {} diff --git a/tests/auto/qml/qmllint/data/settings/qmltypes/custom.qmltypes b/tests/auto/qml/qmllint/data/settings/qmlimports/subdir/Custom/custom.qmltypes similarity index 100% rename from tests/auto/qml/qmllint/data/settings/qmltypes/custom.qmltypes rename to tests/auto/qml/qmllint/data/settings/qmlimports/subdir/Custom/custom.qmltypes diff --git a/tests/auto/qml/qmllint/data/settings/qmlimports/subdir/Custom/qmldir b/tests/auto/qml/qmllint/data/settings/qmlimports/subdir/Custom/qmldir new file mode 100644 index 0000000000..6ad407fd38 --- /dev/null +++ b/tests/auto/qml/qmllint/data/settings/qmlimports/subdir/Custom/qmldir @@ -0,0 +1,2 @@ +module Custom +typeinfo custom.qmltypes diff --git a/tests/auto/qml/qmllint/data/settings/qmltypes/.qmllint.ini b/tests/auto/qml/qmllint/data/settings/qmltypes/.qmllint.ini index 95b02f2f37..3dc2c8fd1b 100644 --- a/tests/auto/qml/qmllint/data/settings/qmltypes/.qmllint.ini +++ b/tests/auto/qml/qmllint/data/settings/qmltypes/.qmllint.ini @@ -1,2 +1,3 @@ [General] -OverwriteImportTypes=custom.qmltypes +OverwriteImportTypes=subdir/custom.qmltypes + diff --git a/tests/auto/qml/qmllint/data/settings/qmltypes/subdir/custom.qmltypes b/tests/auto/qml/qmllint/data/settings/qmltypes/subdir/custom.qmltypes new file mode 100644 index 0000000000..b3839652dc --- /dev/null +++ b/tests/auto/qml/qmllint/data/settings/qmltypes/subdir/custom.qmltypes @@ -0,0 +1,11 @@ +import QtQuick.tooling 1.2 +Module { + dependencies: [] + Component { + name: "Thing" + prototype: "QObject" + exports: [ + "Custom/Thing 1.0", + ] + } +} diff --git a/tests/auto/qml/qmllint/tst_qmllint.cpp b/tests/auto/qml/qmllint/tst_qmllint.cpp index 37b9004517..21cb16c815 100644 --- a/tests/auto/qml/qmllint/tst_qmllint.cpp +++ b/tests/auto/qml/qmllint/tst_qmllint.cpp @@ -1269,11 +1269,12 @@ void TestQmllint::settingsFile() QVERIFY(runQmllint("settings/unusedImportWarning/unused.qml", false, QStringList(), false) .contains(QStringLiteral("Info: %1:2:1: Unused import at %1:2:1") .arg(testFile("settings/unusedImportWarning/unused.qml")))); - QVERIFY(runQmllint("settings/bare/bare.qml", false, { "--bare" }, false, false) + QVERIFY(runQmllint("settings/bare/bare.qml", false, {}, false, false) .contains(QStringLiteral("Failed to find the following builtins: " "builtins.qmltypes, jsroot.qmltypes"))); QVERIFY(runQmllint("settings/qmltypes/qmltypes.qml", false, QStringList(), false) .contains(QStringLiteral("not a qmldir file. Assuming qmltypes."))); + QVERIFY(runQmllint("settings/qmlimports/qmlimports.qml", true, QStringList(), false).isEmpty()); } void TestQmllint::additionalImplicitImport()