diff --git a/src/plugins/autotest/ctest/ctesttreeitem.cpp b/src/plugins/autotest/ctest/ctesttreeitem.cpp index 382241b8805..a09f2172f33 100644 --- a/src/plugins/autotest/ctest/ctesttreeitem.cpp +++ b/src/plugins/autotest/ctest/ctesttreeitem.cpp @@ -117,12 +117,14 @@ QList CTestTreeItem::testConfigurationsFor(const QStringLi config->setProject(project); config->setCommandLine(command); const ProjectExplorer::RunConfiguration *runConfig = target->activeRunConfiguration(); + Utils::Environment env = Utils::Environment::systemEnvironment(); if (QTC_GUARD(runConfig)) { if (auto envAspect = runConfig->aspect()) - config->setEnvironment(envAspect->environment()); - else - config->setEnvironment(Utils::Environment::systemEnvironment()); + env = envAspect->environment(); } + if (Utils::HostOsInfo::isWindowsHost()) + env.set("QT_LOGGING_TO_CONSOLE", "1"); + config->setEnvironment(env); const ProjectExplorer::BuildConfiguration *buildConfig = target->activeBuildConfiguration(); if (QTC_GUARD(buildConfig)) config->setWorkingDirectory(buildConfig->buildDirectory().toString());