aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmltypeloader
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-12-12 01:00:07 +0100
committerUlf Hermann <ulf.hermann@qt.io>2019-12-12 10:06:06 +0100
commit1196b1ef6c5d2cb05ceba5d6f178dc7e2432ed61 (patch)
tree2a99ee28d15d8ee51fc28096e5559bfc2d453e3f /tests/auto/qml/qqmltypeloader
parentfb54af6638dcbeae8ad21249fe234ef4d82c005b (diff)
parentca206bceaff3667469986402e6143bf4c666b228 (diff)
Merge remote-tracking branch 'origin/5.15' into dev
Conflicts: src/qml/types/qqmlbind.cpp Change-Id: Ib992d1a7ac6c1a96d39819be6f23955dc31b44b2
Diffstat (limited to 'tests/auto/qml/qqmltypeloader')
-rw-r--r--tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp b/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp
index d529600723..9ec3e9557b 100644
--- a/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp
+++ b/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp
@@ -58,6 +58,7 @@ private slots:
void qmlSingletonWithinModule();
void multiSingletonModule();
void implicitComponentModule();
+ void customDiskCachePath();
void qrcRootPathUrl();
void implicitImport();
void compositeSingletonCycle();
@@ -533,6 +534,35 @@ void tst_QQMLTypeLoader::implicitComponentModule()
checkCleanCacheLoad(QLatin1String("implicitComponentModule"));
}
+void tst_QQMLTypeLoader::customDiskCachePath()
+{
+#if QT_CONFIG(process)
+ const char *skipKey = "QT_TST_QQMLTYPELOADER_SKIP_MISMATCH";
+ if (qEnvironmentVariableIsSet(skipKey)) {
+ QQmlEngine engine;
+ QQmlComponent component(&engine, testFileUrl("Base.qml"));
+ QCOMPARE(component.status(), QQmlComponent::Ready);
+ QScopedPointer<QObject> obj(component.create());
+ QVERIFY(!obj.isNull());
+ return;
+ }
+
+ QTemporaryDir dir;
+ QProcess child;
+ child.setProgram(QCoreApplication::applicationFilePath());
+ child.setArguments(QStringList(QLatin1String("customDiskCachePath")));
+ QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
+ env.insert(QLatin1String(skipKey), QLatin1String("1"));
+ env.insert(QLatin1String("QML_DISK_CACHE_PATH"), dir.path());
+ child.setProcessEnvironment(env);
+ child.start();
+ QVERIFY(child.waitForFinished());
+ QCOMPARE(child.exitCode(), 0);
+ QDir cacheDir(dir.path());
+ QVERIFY(!cacheDir.isEmpty());
+#endif
+}
+
void tst_QQMLTypeLoader::qrcRootPathUrl()
{
QQmlEngine engine;