AndroidTestRunner: warn if exit code retrieval fails

This helps in debugging instead of returning -1 silently.

Change-Id: I7d145e86af04a6cc0cd0e4a6c2dbe6c4d2fd714c
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit fc4d352683afe681037268955a58e233cffe24eb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Assam Boudjelthia 2024-10-30 17:00:20 +02:00 committed by Qt Cherry-pick Bot
parent bbfc7b2ca9
commit f8d4bab7c0

View File

@ -694,8 +694,10 @@ static int testExitCode()
{
QByteArray exitCodeOutput;
const QString exitCodeCmd = "cat files/qtest_last_exit_code 2> /dev/null"_L1;
if (!execAdbCommand({ "shell"_L1, runCommandAsUserArgs(exitCodeCmd) }, &exitCodeOutput, false))
if (!execAdbCommand({ "shell"_L1, runCommandAsUserArgs(exitCodeCmd) }, &exitCodeOutput, false)) {
qCritical() << "Failed to retrieve the test exit code.";
return EXIT_ERROR;
}
bool ok;
int exitCode = exitCodeOutput.toInt(&ok);