summaryrefslogtreecommitdiffstats
path: root/tests/auto/testlib
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2018-03-09 12:03:01 +0100
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2018-03-12 12:09:51 +0000
commit3ae03c3585df7247f5699eeaa70e1bedf47f6d5b (patch)
tree6991c68b283b98432662a8f49a53abb70bd742b0 /tests/auto/testlib
parent5473535344e7abe12c9a02559020b37480d30d21 (diff)
testlib: Silence all Qt logging in selftests
Otherwise random debug messages from Qt might mess up the expected vs actual results. The setting of QT_LOGGING_RULES in initTestcase has been removed, as the selftest overrides that for each invocation of a subtests, via the processEnvironment() function. Task-number: QTQAINFRA-1631 Change-Id: I855d31274f8261f8b125df23409353f7101be0e4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'tests/auto/testlib')
-rwxr-xr-xtests/auto/testlib/selftests/generate_expected_output.py2
-rw-r--r--tests/auto/testlib/selftests/tst_selftests.cpp3
2 files changed, 2 insertions, 3 deletions
diff --git a/tests/auto/testlib/selftests/generate_expected_output.py b/tests/auto/testlib/selftests/generate_expected_output.py
index 6c14d75ea6..aa11ca4fe7 100755
--- a/tests/auto/testlib/selftests/generate_expected_output.py
+++ b/tests/auto/testlib/selftests/generate_expected_output.py
@@ -257,7 +257,7 @@ def main(name, *args):
# 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')
+ QT_LOGGING_RULES = '*.debug=true;qt.*=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 93d5daa160..63e5721e7e 100644
--- a/tests/auto/testlib/selftests/tst_selftests.cpp
+++ b/tests/auto/testlib/selftests/tst_selftests.cpp
@@ -404,7 +404,6 @@ tst_Selftests::tst_Selftests()
void tst_Selftests::initTestCase()
{
QVERIFY2(tempDir.isValid(), qPrintable(tempDir.errorString()));
- qputenv("QT_LOGGING_RULES", QByteArrayLiteral("*.debug=false")); // Silence any debug output
//Detect the location of the sub programs
QString subProgram = QLatin1String("float/float");
#if defined(Q_OS_WIN)
@@ -644,7 +643,7 @@ static QProcessEnvironment processEnvironment()
// 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"));
+ QStringLiteral("*.debug=true;qt.*=false"));
}
return result;
}