summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorChristian Strømme <christian.stromme@theqtcompany.com>2016-02-10 19:02:40 +0100
committerChristian Stromme <christian.stromme@theqtcompany.com>2016-02-23 21:16:44 +0000
commitd392826959257c9e407fb32d1de62b0b56a2c052 (patch)
tree6f91c892115d3afd684f53cfe1a2a601a110ca12 /tests
parentb6a824d0a3b4fabd9c22fe4c954d50e8755fb509 (diff)
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 <eirik.aavitsland@theqtcompany.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/testlib/selftests/tst_selftests.cpp3
1 files changed, 3 insertions, 0 deletions
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));