aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmltest
diff options
context:
space:
mode:
authorAssam Boudjelthia <assam.boudjelthia@qt.io>2020-08-07 12:32:33 +0300
committerAssam Boudjelthia <assam.boudjelthia@qt.io>2020-08-26 09:17:34 +0300
commit66285fd4954b061a5f912f690704c0bdcadf5c98 (patch)
tree8eb4d58883e39b2b37293878dab57f20d4a12703 /src/qmltest
parenta298775dffb7800b14f74a1b435944b7294728b5 (diff)
[Fix] Use the sourceDir if specified
Android is passing the test path via QUICK_TEST_SOURCE_DIR but it was set to ":/" no matter what. Pick-to: 5.15 Change-Id: If0e6615999019cf1869a237056d41e35b5be12f1 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Diffstat (limited to 'src/qmltest')
-rw-r--r--src/qmltest/quicktest.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/qmltest/quicktest.cpp b/src/qmltest/quicktest.cpp
index da4644f8aa..5962af8569 100644
--- a/src/qmltest/quicktest.cpp
+++ b/src/qmltest/quicktest.cpp
@@ -457,17 +457,18 @@ int quick_test_main_with_setup(int argc, char **argv, const char *name, const ch
}
#endif
-#if defined(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);
if (QFile::exists(s))
testPath = s;
}
+
+#if defined(Q_OS_ANDROID)
+ if (testPath.isEmpty())
+ testPath = QLatin1String(":/");
+#endif
+
if (testPath.isEmpty()) {
QDir current = QDir::current();
#ifdef Q_OS_WIN