aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmltest
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2017-08-22 09:24:17 +0200
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2017-08-22 09:14:13 +0000
commit43472c1e8218ed692aaf3bb32c325d018e6a4527 (patch)
treecd8314a2b28163c6b538a2015c3191079603b92a /src/qmltest
parent768f606cd3cd37c235e85225127201a42d272946 (diff)
Fix finding test data on Android
The standard way of doing Qt Quick testing requires having qml files available in the deployment somewhere in the regular file system. This is not how Android works, where all test data should be deployed as resources. To allow this, we simply hardcode the test path as a resource path on Android instead of checking on the disk. Task-number: QTBUG-45576 Change-Id: I0729f5004a6206d2a10b782eb5b7d83a833c4f51 Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Diffstat (limited to 'src/qmltest')
-rw-r--r--src/qmltest/quicktest.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/qmltest/quicktest.cpp b/src/qmltest/quicktest.cpp
index f62f66170e..8cf0d2918e 100644
--- a/src/qmltest/quicktest.cpp
+++ b/src/qmltest/quicktest.cpp
@@ -277,6 +277,11 @@ int quick_test_main(int argc, char **argv, const char *name, const char *sourceD
}
#endif
+#ifdef Q_OS_ANDROID
+ if (testPath.isEmpty())
+ testPath = QLatin1String(":/");
+#endif
+
// Determine where to look for the test data.
if (testPath.isEmpty() && sourceDir) {
const QString s = QString::fromLocal8Bit(sourceDir);