From 005efa47be3becbf62c0c3bf3e8c9edadf5468f7 Mon Sep 17 00:00:00 2001 From: Yun Liu Date: Fri, 28 Jun 2019 17:25:10 +0000 Subject: [PATCH] Add --coverage-dir to android gtest parser 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 Reviewed-by: John Budorick Cr-Commit-Position: refs/heads/master@{#673390} --- build/android/pylib/gtest/gtest_test_instance.py | 9 +++++++-- build/android/test_runner.py | 4 ++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/build/android/pylib/gtest/gtest_test_instance.py b/build/android/pylib/gtest/gtest_test_instance.py index 3d38686152b621..6db67b7ccfb631 100644 --- a/build/android/pylib/gtest/gtest_test_instance.py +++ b/build/android/pylib/gtest/gtest_test_instance.py @@ -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] @@ -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 diff --git a/build/android/test_runner.py b/build/android/test_runner.py index 232ec523aea470..701b22d437a530 100755 --- a/build/android/test_runner.py +++ b/build/android/test_runner.py @@ -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):