From 48dbc72c4467d120353dba46fdbc2f8ddc145629 Mon Sep 17 00:00:00 2001 From: Assam Boudjelthia Date: Thu, 16 Jan 2025 17:05:36 +0200 Subject: [PATCH] AndroidTestRunner: print failed build output when no --verbose is used This helps with better debugging where in most cases the tests are run without --verbose, but if there's a build error, it won't be clear what went wrong, and only re-running with --verbose would give such details, which is just annoying to deal with. Pick-to: 6.9 Change-Id: Icb8bcb8e5ba297d48b9e166c93523f25a21937b2 Reviewed-by: Ville Voutilainen --- src/tools/androidtestrunner/main.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tools/androidtestrunner/main.cpp b/src/tools/androidtestrunner/main.cpp index 2b9199c479b..01a20f524bb 100644 --- a/src/tools/androidtestrunner/main.cpp +++ b/src/tools/androidtestrunner/main.cpp @@ -822,8 +822,10 @@ int main(int argc, char *argv[]) return EXIT_ERROR; } - if (!execCommand(g_options.makeCommand, nullptr, true)) { - qCritical("The build command \"%s\" failed", qPrintable(g_options.makeCommand)); + QByteArray buildOutput; + if (!execCommand(g_options.makeCommand, &buildOutput, true)) { + qCritical("The APK build command \"%s\" failed\n\n%s", + qPrintable(g_options.makeCommand), buildOutput.constData()); return EXIT_ERROR; }