Skip to content

Commit

Permalink
Add --coverage-dir to android gtest parser
Browse files Browse the repository at this point in the history
Add the same flag as instrumentation and junit test options
to process coverage data later and avoid unknown flag on remote.

Bug: 972171
Change-Id: Ib982062adf64b5f7d7d221c166c5b0d23fab519f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1681273
Commit-Queue: Yun Liu <yliuyliu@google.com>
Reviewed-by: John Budorick <jbudorick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#673390}
  • Loading branch information
Yun Liu authored and Commit Bot committed Jun 28, 2019
1 parent 97b5560 commit 005efa4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 7 additions & 2 deletions build/android/pylib/gtest/gtest_test_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,13 +257,14 @@ def __init__(self, args, data_deps_delegate, error_func):
# TODO(jbudorick): Support multiple test suites.
if len(args.suite_name) > 1:
raise ValueError('Platform mode currently supports only 1 gtest suite')
self._isolated_script_test_perf_output = (
args.isolated_script_test_perf_output)
self._coverage_dir = args.coverage_dir
self._exe_dist_dir = None
self._external_shard_index = args.test_launcher_shard_index
self._extract_test_list_from_filter = args.extract_test_list_from_filter
self._filter_tests_lock = threading.Lock()
self._gs_test_artifacts_bucket = args.gs_test_artifacts_bucket
self._isolated_script_test_perf_output = (
args.isolated_script_test_perf_output)
self._shard_timeout = args.shard_timeout
self._store_tombstones = args.store_tombstones
self._suite = args.suite_name[0]
Expand Down Expand Up @@ -367,6 +368,10 @@ def app_file_dir(self):
def app_files(self):
return self._app_data_files

@property
def coverage_dir(self):
return self._coverage_dir

@property
def enable_xml_result_parsing(self):
return self._enable_xml_result_parsing
Expand Down
4 changes: 4 additions & 0 deletions build/android/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,10 @@ def AddGTestOptions(parser):
'-w', '--wait-for-java-debugger', action='store_true',
help='Wait for java debugger to attach before running any application '
'code. Also disables test timeouts and sets retries=0.')
parser.add_argument(
'--coverage-dir',
type=os.path.realpath,
help='Directory in which to place all generated coverage files.')


def AddInstrumentationTestOptions(parser):
Expand Down

0 comments on commit 005efa4

Please sign in to comment.