From f5e0d2e8792ff9915cb8d905e5877f202234c8f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 17 Sep 2024 21:34:12 +0200 Subject: [PATCH] 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. Change-Id: I17b6b83844c4160aa5980d954b70f2582ff94da5 Reviewed-by: Volker Hilsheimer Reviewed-by: Timur Pocheptsov (cherry picked from commit 493fa52e135f73c1496715bb45602d9a4da1ade4) Reviewed-by: Qt Cherry-pick Bot --- tests/auto/testlib/selftests/tst_selftests.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/auto/testlib/selftests/tst_selftests.cpp b/tests/auto/testlib/selftests/tst_selftests.cpp index 04185e95cdb..08c3d657977 100644 --- a/tests/auto/testlib/selftests/tst_selftests.cpp +++ b/tests/auto/testlib/selftests/tst_selftests.cpp @@ -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; }