Chromium Code Reviews| 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 a203ce069e5bc4760c2a84be3808e1aae3fb94f6..fdf2051841a7d895582aebfa3091adb4d3e1098f 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 |
| @@ -6,11 +6,13 @@ import logging |
| import os |
| import posixpath |
| import re |
| +import sys |
| import time |
| from devil.android import device_errors |
| from devil.android import flag_changer |
| from devil.utils import reraiser_thread |
| +from pylib import constants |
| from pylib import valgrind_tools |
| from pylib.base import base_test_result |
| from pylib.instrumentation import instrumentation_test_instance |
| @@ -19,6 +21,10 @@ from pylib.local.device import local_device_test_run |
| import tombstones |
| +sys.path.append(os.path.abspath(os.path.join( |
| + constants.DIR_SOURCE_ROOT, 'build', 'android', 'pylib', 'android'))) |
|
jbudorick
2016/11/22 14:40:15
You shouldn't need to do this.
BigBossZhiling
2016/11/23 00:28:07
Done.
|
| +import logcat_monitor_with_logdog |
|
jbudorick
2016/11/22 14:40:14
You should be able to import this as
from pylib
BigBossZhiling
2016/11/23 00:28:07
Done.
|
| + |
| _TAG = 'test_runner_py' |
| TIMEOUT_ANNOTATIONS = [ |
| @@ -245,10 +251,16 @@ class LocalDeviceInstrumentationTestRun( |
| device.RunShellCommand( |
| ['log', '-p', 'i', '-t', _TAG, 'START %s' % test_name], |
| check_return=True) |
| + logcat_url = None |
| time_ms = lambda: int(time.time() * 1e3) |
| start_ms = time_ms() |
| - output = device.StartInstrumentation( |
| - target, raw=True, extras=extras, timeout=timeout, retries=0) |
| + with logcat_monitor_with_logdog.LogcatMonitorWithLogdog( |
|
jbudorick
2016/11/22 14:40:14
I'm concerned about always doing this, particularl
BigBossZhiling
2016/11/23 00:28:07
Done.
|
| + device.adb, |
| + 'logcat_%s' % test_name.replace('#', '.')) as logmon: |
| + output = device.StartInstrumentation( |
| + target, raw=True, extras=extras, timeout=timeout, retries=0) |
| + logcat_url = logmon.GetLogcatURL() |
| + logmon.Close() |
| finally: |
| device.RunShellCommand( |
| ['log', '-p', 'i', '-t', _TAG, 'END %s' % test_name], |
| @@ -266,6 +278,8 @@ class LocalDeviceInstrumentationTestRun( |
| self._test_instance.ParseAmInstrumentRawOutput(output)) |
| results = self._test_instance.GenerateTestResults( |
| result_code, result_bundle, statuses, start_ms, duration_ms) |
| + for result in results: |
| + result.SetLogcatUrl(logcat_url) |
| # Update the result name if the test used flags. |
| if flags: |