summaryrefslogtreecommitdiffstats
path: root/src/testlib/qtestcase.cpp
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2018-02-08 15:10:34 +0100
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2018-02-10 12:54:52 +0000
commit0b48fcee709ac0070d7b9213632edeafeeddc9e1 (patch)
tree901ea23b9952b94d2426a7af88c53bc73fc0e2f2 /src/testlib/qtestcase.cpp
parent24a93798b8ef2f070896fd38113ae59e7f5062f8 (diff)
testlib: Don't set QT_LOGGING_TO_CONSOLE
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 <thiago.macieira@intel.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/testlib/qtestcase.cpp')
-rw-r--r--src/testlib/qtestcase.cpp7
1 files changed, 0 insertions, 7 deletions
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");
}