forked from qt-creator/qt-creator
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 <david.schulz@qt.io>
This commit is contained in:
@@ -122,8 +122,10 @@ QList<ITestConfiguration *> CTestTreeItem::testConfigurationsFor(const QStringLi
|
||||
if (auto envAspect = runConfig->aspect<ProjectExplorer::EnvironmentAspect>())
|
||||
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))
|
||||
|
@@ -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));
|
||||
|
Reference in New Issue
Block a user