From 0b48fcee709ac0070d7b9213632edeafeeddc9e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Thu, 8 Feb 2018 15:10:34 +0100 Subject: testlib: Don't set QT_LOGGING_TO_CONSOLE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QtTestLib has its own message handler installed via qInstallMessageHandler, so there is no need to set QT_LOGGING_TO_CONSOLE to force stderr output, as that's what QPlainTestLogger::outputMessage uses anyways. And in the case of using other testlib outputs such as XML, we're not going to hit any of the code paths that would check QT_LOGGING_TO_CONSOLE. The only relevant exception is Windows, which checks stderrHasConsoleAttached(), which is affected by QT_LOGGING_TO_CONSOLE, but Qt Creator actually has an explicit inversion of this existing code, to prevent it from setting QT_LOGGING_TO_CONSOLE, so that output ends up in OutputDebugStringA and can be read and distinguished from the debugger's output. See QTCREATORBUG-16161. Change-Id: Ia8a9b00b221ec5691b52485586f172c9261bf299 Reviewed-by: Thiago Macieira Reviewed-by: Tor Arne Vestbø --- src/testlib/qtestcase.cpp | 7 ------- 1 file changed, 7 deletions(-) (limited to 'src/testlib') diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index 8cd685f7ef..497470464f 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -1667,15 +1667,8 @@ static LONG WINAPI windowsFaultHandler(struct _EXCEPTION_POINTERS *exInfo) } #endif // Q_OS_WIN) && !Q_OS_WINRT -static void qputenvIfEmpty(const char *name, const QByteArray &value) -{ - if (qEnvironmentVariableIsEmpty(name)) - qputenv(name, value); -} - static void initEnvironment() { - qputenvIfEmpty("QT_LOGGING_TO_CONSOLE", "1"); qputenv("QT_QTESTLIB_RUNNING", "1"); } -- cgit v1.2.3