selftest: Disable NSLog/CFLog output to stderr

Ideally we want to catch if any of our selftests produce errors or
warnings from system frameworks that are out fault, but in this case
the warning does not seem to be something we can do anything about.

The "+[IMKClient subclass]: chose IMKClient_Legacy" warning is logged
via NSLog, so as a workaround we disable NSLog/CFLog output to stderr.

Pick-to: 6.8
Change-Id: I17b6b83844c4160aa5980d954b70f2582ff94da5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This commit is contained in:
Tor Arne Vestbø 2024-09-17 21:34:12 +02:00
parent 9fbfe72649
commit 493fa52e13

View File

@ -959,6 +959,13 @@ static QProcessEnvironment testEnvironment()
// Avoid the warning from QCoreApplication
environment.insert("LC_ALL", "en_US.UTF-8");
#endif
#if defined(Q_OS_MACOS)
// Work around system framework spamming logs with
// "+[IMKClient subclass]: chose IMKClient_Legacy"
if (QOperatingSystemVersion::current() >= QOperatingSystemVersion::MacOSSequoia)
environment.insert("CFLOG_FORCE_DISABLE_STDERR", "1");
#endif
}
return environment;
}