Index: build/android/test_runner.py |
diff --git a/build/android/test_runner.py b/build/android/test_runner.py |
index 08ec868e2b55155acc85e226f9088fae6134bda1..1869bc949e4d5a4f604ff73b1dc6a4a4b7445168 100755 |
--- a/build/android/test_runner.py |
+++ b/build/android/test_runner.py |
@@ -12,6 +12,7 @@ import contextlib |
import itertools |
import logging |
import os |
+import shutil |
import signal |
import sys |
import threading |
@@ -36,6 +37,7 @@ from pylib.base import test_run_factory |
from pylib.constants import host_paths |
from pylib.results import json_results |
from pylib.results import report_results |
+from pylib.utils import logdog_helper |
from py_utils import contextlib_ext |
@@ -115,6 +117,9 @@ def AddCommonOptions(parser): |
help='Path to save test_runner trace data to. This option ' |
'has been implemented for gtest, instrumentation ' |
'test and perf test.') |
+ group.add_argument('--upload-logcats-file', action='store_true', |
+ dest='upload_logcats_file', |
+ help='Whether to upload logcat file to logdog.') |
logcat_output_group = group.add_mutually_exclusive_group() |
logcat_output_group.add_argument( |
@@ -774,6 +779,16 @@ def RunTestsInPlatformMode(args): |
str(all_pass), |
str(tot_tests), |
str(iteration_count)) |
+ if args.upload_logcats_file: |
jbudorick
2017/03/04 01:22:33
We should handle this similarly to json_writer s.t
BigBossZhiling
2017/03/04 02:14:59
Done.
|
+ if not args.logcat_output_file: |
+ logging.critical('Cannot upload logcats file. ' |
+ 'File to save logcat is not specified.') |
+ else: |
+ with open(args.logcat_output_file) as src: |
+ dst = logdog_helper.open_text('unified_logcats') |
BigBossZhiling
2017/03/04 00:59:14
@mikecase's NotRaiseException doesn't raise any ex
jbudorick
2017/03/04 01:22:33
ack. We should log something if dst is None, thoug
BigBossZhiling
2017/03/04 02:14:58
I think Case's decorator logs it. It doesn't raise
|
+ if dst: |
+ with open(dst) as dst: |
+ shutil.copyfileobj(src, dst) |
if args.command == 'perf' and (args.steps or args.single_step): |
return 0 |