AndroidTestRunner: print test output to stdout instead of stderr

by default qDebug() prints to stderr which means any process expecting
the test output under stdout would not get any output, and in any case,
the test output shouldn't be printed to stderr. This also applies to
verbose commands output.

Change-Id: Ifa77757176060f6452172768f3c7950019863775
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 6b66bb9a21c3ed6bf94a9fca6a0dc20a9e64c9ad)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Assam Boudjelthia 2024-10-08 01:20:08 +03:00 committed by Qt Cherry-pick Bot
parent d321030575
commit 9cb3cd1d36

View File

@ -156,7 +156,7 @@ static bool execCommand(const QString &program, const QStringList &args,
const auto command = program + " "_L1 + args.join(u' ');
if (verbose && g_options.verbose)
qDebug("Execute %s.", command.toUtf8().constData());
fprintf(stdout,"Execute %s.\n", command.toUtf8().constData());
QProcess process;
process.start(program, args);
@ -178,7 +178,7 @@ static bool execCommand(const QString &program, const QStringList &args,
output->append(stdOut);
if (verbose && g_options.verbose)
qDebug() << stdOut.constData();
fprintf(stdout, "%s\n", stdOut.constData());
return process.exitCode() == 0;
}
@ -531,7 +531,7 @@ static bool pullFiles()
auto checkerIt = g_options.checkFiles.find(outSuffix);
ret &= (checkerIt != g_options.checkFiles.end() && checkerIt.value()(output));
if (it.value() == "-"_L1) {
qDebug() << output.constData();
fprintf(stdout, "%s\n", output.constData());
} else {
QFile out{it.value()};
if (!out.open(QIODevice::WriteOnly))