AndroidTestRunner: warn if exit code retrieval fails

This helps in debugging instead of returning -1 silently.

Pick-to: 6.8
Change-Id: I7d145e86af04a6cc0cd0e4a6c2dbe6c4d2fd714c
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
Assam Boudjelthia 2024-10-30 17:00:20 +02:00
parent e45d78ecba
commit fc4d352683

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);