From 43472c1e8218ed692aaf3bb32c325d018e6a4527 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 22 Aug 2017 09:24:17 +0200 Subject: 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 --- src/qmltest/quicktest.cpp | 5 +++++ 1 file changed, 5 insertions(+) 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); -- cgit v1.2.3