From 368a6614f3a215d20f5f92a9b4730bfa9f599f90 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Thu, 2 Sep 2021 14:26:48 +0200 Subject: [PATCH] AutoTest: Fix getting more output from ctest on Windows When running ctest with Qt based tests we missed output coming from qtestlib. Due to running a separate QProcess we need to force the output on stderr to be printed not via the Windows debug console. Change-Id: Ie3b957230836efd59f11b6a1e7ac310fa44fa073 Reviewed-by: David Schulz --- src/plugins/autotest/ctest/ctesttreeitem.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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());