AndroidTestRunner: don't automatically print logcat unless its a crash
Print logcats only if it's explicitly requested with the respective argument or if there was a crash, i.e. where we can't get the test's exit code. Otherweise, in case of normal failure, we don't really need to pollute the output. Change-Id: Ic4e6db5d9fd6786bd28204a3ec87f63a7ec9764a Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> (cherry picked from commit 256fd95a712384c6d5b8b1841ab9c749fca89970) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
266653fee4
commit
bff859c2ed
@ -235,7 +235,7 @@ static void printHelp()
|
|||||||
"\n"
|
"\n"
|
||||||
" --show-logcat: Print Logcat output to stdout. If an ANR occurs during\n"
|
" --show-logcat: Print Logcat output to stdout. If an ANR occurs during\n"
|
||||||
" the test run, logs from the system_server process are included.\n"
|
" the test run, logs from the system_server process are included.\n"
|
||||||
" This argument is implied if a test fails.\n"
|
" This argument is implied if a test crashes.\n"
|
||||||
"\n"
|
"\n"
|
||||||
" --ndk-stack: Path to ndk-stack tool that symbolizes crash stacktraces.\n"
|
" --ndk-stack: Path to ndk-stack tool that symbolizes crash stacktraces.\n"
|
||||||
" By default, ANDROID_NDK_ROOT env var is used to deduce the tool path.\n"
|
" By default, ANDROID_NDK_ROOT env var is used to deduce the tool path.\n"
|
||||||
@ -720,16 +720,17 @@ void analyseLogcat(const QString &timeStamp, int *exitCode)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we have a failure, attempt to print both logcat and the crash buffer which
|
// If we have a crash, attempt to print both logcat and the crash buffer which
|
||||||
// includes the crash stacktrace that is not included in the default logcat.
|
// includes the crash stacktrace that is not included in the default logcat.
|
||||||
if (g_options.showLogcatOutput || *exitCode != 0) {
|
const bool testCrashed = *exitCode == EXIT_ERROR && !g_testInfo.isTestRunnerInterrupted.load();
|
||||||
|
if (g_options.showLogcatOutput || testCrashed) {
|
||||||
qDebug() << "********** logcat dump **********";
|
qDebug() << "********** logcat dump **********";
|
||||||
qDebug().noquote() << testLogcat.join(u'\n').trimmed();
|
qDebug().noquote() << testLogcat.join(u'\n').trimmed();
|
||||||
qDebug() << "********** End logcat dump **********";
|
qDebug() << "********** End logcat dump **********";
|
||||||
}
|
|
||||||
|
|
||||||
if (!crashLogcat.isEmpty() && *exitCode != 0)
|
if (!crashLogcat.isEmpty())
|
||||||
printLogcatCrash(crashLogcat);
|
printLogcatCrash(crashLogcat);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static QString getCurrentTimeString()
|
static QString getCurrentTimeString()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user