From e76f83aa90e8fa16aba175cb6ef5b14fe56555d7 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Thu, 2 Sep 2021 15:12:28 +0200 Subject: [PATCH] AutoTest: Silence deprecation warning When using Qt5.11+ we run into some deprecation warning for the logging handling on Windows. Silence this by specifying the new environment variable as well which is checked first. Change-Id: I1ca2b826de4516c606b260d053b949b5761c8414 Reviewed-by: David Schulz --- src/plugins/autotest/ctest/ctesttreeitem.cpp | 4 +++- src/plugins/autotest/qtest/qttest_utils.cpp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plugins/autotest/ctest/ctesttreeitem.cpp b/src/plugins/autotest/ctest/ctesttreeitem.cpp index a09f2172f33..73c3481f970 100644 --- a/src/plugins/autotest/ctest/ctesttreeitem.cpp +++ b/src/plugins/autotest/ctest/ctesttreeitem.cpp @@ -122,8 +122,10 @@ QList CTestTreeItem::testConfigurationsFor(const QStringLi if (auto envAspect = runConfig->aspect()) env = envAspect->environment(); } - if (Utils::HostOsInfo::isWindowsHost()) + if (Utils::HostOsInfo::isWindowsHost()) { + env.set("QT_FORCE_STDERR_LOGGING", "1"); env.set("QT_LOGGING_TO_CONSOLE", "1"); + } config->setEnvironment(env); const ProjectExplorer::BuildConfiguration *buildConfig = target->activeBuildConfiguration(); if (QTC_GUARD(buildConfig)) diff --git a/src/plugins/autotest/qtest/qttest_utils.cpp b/src/plugins/autotest/qtest/qttest_utils.cpp index e3ff48174f4..8f945367066 100644 --- a/src/plugins/autotest/qtest/qttest_utils.cpp +++ b/src/plugins/autotest/qtest/qttest_utils.cpp @@ -153,8 +153,10 @@ QStringList filterInterfering(const QStringList &provided, QStringList *omitted, Utils::Environment prepareBasicEnvironment(const Utils::Environment &env) { Utils::Environment result(env); - if (Utils::HostOsInfo::isWindowsHost()) + if (Utils::HostOsInfo::isWindowsHost()) { + result.set("QT_FORCE_STDERR_LOGGING", "1"); result.set("QT_LOGGING_TO_CONSOLE", "1"); + } const int timeout = AutotestPlugin::settings()->timeout; if (timeout > 5 * 60 * 1000) // Qt5.5 introduced hard limit, Qt5.6.1 added env var to raise this result.set("QTEST_FUNCTION_TIMEOUT", QString::number(timeout));