AndroidTestRunner: forward QT_* env vars to the tests

Forward QT_* env vars to the test same like QTEST_* vars,
this can be useful when debugging, this would allow us to
pass QT_DEBUG_PLUGINS.

Change-Id: I9404ff7c7276f87e3e7d9cf57fa8f5b1eed02eb7
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
(cherry picked from commit 574c966ac8ce0527e14e6cb5dc23a4a411fc8003)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Assam Boudjelthia 2024-10-03 13:53:35 +03:00 committed by Qt Cherry-pick Bot
parent 0af10419ab
commit 359abfdf9b

View File

@ -408,11 +408,11 @@ static bool parseTestArgs()
testAppArgs = "\"%1\""_L1.arg(testAppArgs.trimmed());
const QString activityName = "%1/%2"_L1.arg(g_options.package).arg(g_options.activity);
// Pass over any testlib env vars if set
// Pass over any qt or testlib env vars if set
QString testEnvVars;
const QStringList envVarsList = QProcessEnvironment::systemEnvironment().toStringList();
for (const QString &var : envVarsList) {
if (var.startsWith("QTEST_"_L1))
if (var.startsWith("QTEST_"_L1) || var.startsWith("QT_"_L1))
testEnvVars += "%1 "_L1.arg(var);
}