summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xtests/auto/testlib/selftests/generate_expected_output.py8
-rw-r--r--tests/auto/testlib/selftests/tst_selftests.cpp4
2 files changed, 11 insertions, 1 deletions
diff --git a/tests/auto/testlib/selftests/generate_expected_output.py b/tests/auto/testlib/selftests/generate_expected_output.py
index a3a66da98b..6c14d75ea6 100755
--- a/tests/auto/testlib/selftests/generate_expected_output.py
+++ b/tests/auto/testlib/selftests/generate_expected_output.py
@@ -252,7 +252,13 @@ def generateTestData(testname, clean,
def main(name, *args):
"""Minimal argument parsing and driver for the real work"""
- os.environ['LC_ALL'] = 'C'
+ os.environ.update(
+ LC_ALL = 'C', # Use standard locale
+ # Avoid interference from any qtlogging.ini files, e.g. in
+ # /etc/xdg/QtProject/, (must match tst_selftests.cpp's
+ # processEnvironment()'s value):
+ QT_LOGGING_RULES = '*.debug=true;qt.qpa.screen=false')
+
herePath = os.getcwd()
cleaner = Cleaner(herePath, name)
diff --git a/tests/auto/testlib/selftests/tst_selftests.cpp b/tests/auto/testlib/selftests/tst_selftests.cpp
index 64f324e26c..9bb3c9b2d4 100644
--- a/tests/auto/testlib/selftests/tst_selftests.cpp
+++ b/tests/auto/testlib/selftests/tst_selftests.cpp
@@ -568,6 +568,10 @@ static QProcessEnvironment processEnvironment()
if (useVariable)
result.insert(key, systemEnvironment.value(key));
}
+ // Avoid interference from any qtlogging.ini files, e.g. in /etc/xdg/QtProject/:
+ result.insert(QStringLiteral("QT_LOGGING_RULES"),
+ // Must match generate_expected_output.py's main()'s value:
+ QStringLiteral("*.debug=true;qt.qpa.screen=false"));
}
return result;
}