tst_qmllint: Fix settings tests
Some of the settings tests were broken in a way where they could never fail, even if the feature was broken. This is fixed now. Also expanded the tests to also cover the additional qml import path option. Change-Id: Ibd5b8fde36362ccf0cc3b9d7d639c2485fd6ae77 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
parent
4125efb29e
commit
dd0e69a20b
|
@ -1,2 +1,2 @@
|
||||||
[Foo]
|
[General]
|
||||||
DisableDefaultImports=true
|
DisableDefaultImports=true
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
[General]
|
||||||
|
AdditionalQmlImportPaths=subdir
|
|
@ -0,0 +1,3 @@
|
||||||
|
import Custom
|
||||||
|
|
||||||
|
Thing {}
|
|
@ -0,0 +1,2 @@
|
||||||
|
module Custom
|
||||||
|
typeinfo custom.qmltypes
|
|
@ -1,2 +1,3 @@
|
||||||
[General]
|
[General]
|
||||||
OverwriteImportTypes=custom.qmltypes
|
OverwriteImportTypes=subdir/custom.qmltypes
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
import QtQuick.tooling 1.2
|
||||||
|
Module {
|
||||||
|
dependencies: []
|
||||||
|
Component {
|
||||||
|
name: "Thing"
|
||||||
|
prototype: "QObject"
|
||||||
|
exports: [
|
||||||
|
"Custom/Thing 1.0",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
|
@ -1269,11 +1269,12 @@ void TestQmllint::settingsFile()
|
||||||
QVERIFY(runQmllint("settings/unusedImportWarning/unused.qml", false, QStringList(), false)
|
QVERIFY(runQmllint("settings/unusedImportWarning/unused.qml", false, QStringList(), false)
|
||||||
.contains(QStringLiteral("Info: %1:2:1: Unused import at %1:2:1")
|
.contains(QStringLiteral("Info: %1:2:1: Unused import at %1:2:1")
|
||||||
.arg(testFile("settings/unusedImportWarning/unused.qml"))));
|
.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: "
|
.contains(QStringLiteral("Failed to find the following builtins: "
|
||||||
"builtins.qmltypes, jsroot.qmltypes")));
|
"builtins.qmltypes, jsroot.qmltypes")));
|
||||||
QVERIFY(runQmllint("settings/qmltypes/qmltypes.qml", false, QStringList(), false)
|
QVERIFY(runQmllint("settings/qmltypes/qmltypes.qml", false, QStringList(), false)
|
||||||
.contains(QStringLiteral("not a qmldir file. Assuming qmltypes.")));
|
.contains(QStringLiteral("not a qmldir file. Assuming qmltypes.")));
|
||||||
|
QVERIFY(runQmllint("settings/qmlimports/qmlimports.qml", true, QStringList(), false).isEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestQmllint::additionalImplicitImport()
|
void TestQmllint::additionalImplicitImport()
|
||||||
|
|
Loading…
Reference in New Issue