From 5a07f6ca4e7f00fada0db7f21892500831d537bb Mon Sep 17 00:00:00 2001 From: Assam Boudjelthia Date: Mon, 21 Oct 2024 15:40:38 +0300 Subject: [PATCH] AndroidTestRunner: print colored and brief logcats Use colors only for non-ci environment since color characters just make the output noisy and they are not rendered correctly. Pick-to: 6.8 Change-Id: I14c5f9c215fbbe9a020011943455d2df615d9bee Reviewed-by: Ville Voutilainen --- src/tools/androidtestrunner/main.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/tools/androidtestrunner/main.cpp b/src/tools/androidtestrunner/main.cpp index a3beb4b39e9..2f995f04095 100644 --- a/src/tools/androidtestrunner/main.cpp +++ b/src/tools/androidtestrunner/main.cpp @@ -555,7 +555,11 @@ static bool pullResults() void printLogcat(const QString &formattedTime) { - QStringList logcatArgs = { "logcat"_L1 }; + QStringList logcatArgs = { "logcat"_L1, "-v"_L1, "brief"_L1 }; + + if (qEnvironmentVariable("QTEST_ENVIRONMENT") != "ci"_L1) + logcatArgs << "-v"_L1 << "color"_L1; + if (g_testInfo.sdkVersion <= 23 || g_testInfo.pid == -1) logcatArgs << "-t"_L1 << formattedTime; else