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 <ville.voutilainen@qt.io>
This commit is contained in:
Assam Boudjelthia 2025-01-16 17:05:36 +02:00
parent 256fd95a71
commit 48dbc72c44

View File

@ -822,8 +822,10 @@ int main(int argc, char *argv[])
return EXIT_ERROR; return EXIT_ERROR;
} }
if (!execCommand(g_options.makeCommand, nullptr, true)) { QByteArray buildOutput;
qCritical("The build command \"%s\" failed", qPrintable(g_options.makeCommand)); 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; return EXIT_ERROR;
} }