Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Unified Diff: build/android/pylib/local/device/local_device_instrumentation_test_run.py

Issue 2451523002: Insert logcat as part of test result for android instrumentation tests. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: build/android/pylib/local/device/local_device_instrumentation_test_run.py
diff --git a/build/android/pylib/local/device/local_device_instrumentation_test_run.py b/build/android/pylib/local/device/local_device_instrumentation_test_run.py
index 6c00b7087dc9f5c44aeabdc2ca2abe8a17c0174c..94a51428d394aef7829e8eef7cfdfba551c354b9 100644
--- a/build/android/pylib/local/device/local_device_instrumentation_test_run.py
+++ b/build/android/pylib/local/device/local_device_instrumentation_test_run.py
@@ -263,8 +263,13 @@ class LocalDeviceInstrumentationTestRun(
check_return=True)
time_ms = lambda: int(time.time() * 1e3)
start_ms = time_ms()
- output = device.StartInstrumentation(
- target, raw=True, extras=extras, timeout=timeout, retries=0)
+ logcat = ''
+ with device.GetLogcatMonitor() as logmon:
+ output = device.StartInstrumentation(
+ target, raw=True, extras=extras, timeout=timeout, retries=0)
+ for logstring in logmon.FindAll(r'.*'):
jbudorick 2016/10/25 02:17:35 There are a couple of better options for dumping t
BigBossZhiling 2016/10/25 22:08:44 Done.
+ logcat += logstring.group(0) + '\n'
+ logmon.Close()
finally:
device.RunShellCommand(
['log', '-p', 'i', '-t', _TAG, 'END %s' % test_name],
@@ -281,7 +286,7 @@ class LocalDeviceInstrumentationTestRun(
result_code, result_bundle, statuses = (
self._test_instance.ParseAmInstrumentRawOutput(output))
results = self._test_instance.GenerateTestResults(
- result_code, result_bundle, statuses, start_ms, duration_ms)
+ result_code, result_bundle, statuses, start_ms, duration_ms, logcat)
# Update the result name if the test used flags.
if flags:

Powered by Google App Engine
This is Rietveld 408576698