From d392826959257c9e407fb32d1de62b0b56a2c052 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Str=C3=B8mme?= Date: Wed, 10 Feb 2016 19:02:40 +0100 Subject: [PATCH] Make it possible to preserve the library/plugin path in tst_selftest If QT_PRESERVE_TESTLIB_PATH is set, then LD_LIBRARY_PATH and QT_PLUGIN_PATH won't be filtered out for the sub-tests started by tst_selftest. Change-Id: Ic43ba9b4d882ee36b2f7495b1c880f26aefd2629 Reviewed-by: aavit --- tests/auto/testlib/selftests/tst_selftests.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/auto/testlib/selftests/tst_selftests.cpp b/tests/auto/testlib/selftests/tst_selftests.cpp index 94002ec75b..0806077031 100644 --- a/tests/auto/testlib/selftests/tst_selftests.cpp +++ b/tests/auto/testlib/selftests/tst_selftests.cpp @@ -543,6 +543,7 @@ static QProcessEnvironment processEnvironment() static QProcessEnvironment result; if (result.isEmpty()) { const QProcessEnvironment systemEnvironment = QProcessEnvironment::systemEnvironment(); + const bool preserveLibPath = qEnvironmentVariableIsSet("QT_PRESERVE_TESTLIB_PATH"); foreach (const QString &key, systemEnvironment.keys()) { const bool useVariable = key == QLatin1String("PATH") || key == QLatin1String("QT_QPA_PLATFORM") #if defined(Q_OS_QNX) @@ -557,6 +558,8 @@ static QProcessEnvironment processEnvironment() #ifdef __COVERAGESCANNER__ || key == QLatin1String("QT_TESTCOCOON_ACTIVE") #endif + || ( preserveLibPath && (key == QLatin1String("QT_PLUGIN_PATH") + || key == QLatin1String("LD_LIBRARY_PATH"))) ; if (useVariable) result.insert(key, systemEnvironment.value(key));