From 118f2210c6279803b9a4103a796ce75e88f8beb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Thu, 27 Jul 2023 16:39:54 +0200 Subject: [PATCH] tst_selftests: Fix mistaken early return when checking error output In porting the selftest machinery to Catch2 in 24e83de8d192 we accidentally added an unconditional early return when determining whether to check for unexpected stderr output, resulting in not checking error output on any platform. The return statement has now been moved into the Q_CC_MINGW condition, but as we now seem to have similar issues on macOS and Linux with some of the tests outputting "Received signal 6 (SIGABRT)" as we do for QEMU, we need to add a few more explicit early return conditions to the function. Pick-to: 6.5 6.6 Change-Id: I7a25f000843b5f1003a5db883f08285185046b46 Reviewed-by: Qt CI Bot Reviewed-by: Edward Welbourne --- tests/auto/testlib/selftests/tst_selftests.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/auto/testlib/selftests/tst_selftests.cpp b/tests/auto/testlib/selftests/tst_selftests.cpp index 2265fe31474..8f228a7b85e 100644 --- a/tests/auto/testlib/selftests/tst_selftests.cpp +++ b/tests/auto/testlib/selftests/tst_selftests.cpp @@ -767,14 +767,22 @@ void checkErrorOutput(const QString &test, const QByteArray &errorOutput) #ifdef Q_CC_MINGW if (test == "blacklisted" // calls qFatal() || test == "silent") // calls qFatal() -#endif return; +#endif #ifdef Q_OS_WIN if (test == "crashes") return; // Complains about uncaught exception #endif +#ifdef Q_OS_UNIX + if (test == "assert" + || test == "crashes" + || test == "failfetchtype" + || test == "faildatatype") + return; // Outputs "Received signal 6 (SIGABRT)" +#endif + #ifdef Q_OS_LINUX // QEMU outputs to stderr about uncaught signals if (QTestPrivate::isRunningArmOnX86() &&