Commit 689ff262 authored by Ben Joyce's avatar Ben Joyce Committed by Commit Bot

Fix Jacoco Report exclusion variable.

Bug: 1107004
Change-Id: I2a84c60bff2b0a93145852e7bab15d5dead55169
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2327893
Commit-Queue: benjamin joyce <bjoyce@chromium.org>
Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#793246}
parent 5f3fdc72
...@@ -41,16 +41,16 @@ _PARTIAL_PACKAGE_NAMES = ['com/google', 'org/chromium'] ...@@ -41,16 +41,16 @@ _PARTIAL_PACKAGE_NAMES = ['com/google', 'org/chromium']
_SOURCES_JSON_FILES_SUFFIX = '__jacoco_sources.json' _SOURCES_JSON_FILES_SUFFIX = '__jacoco_sources.json'
# These should match the jar class files generated in internal_rules.gni # These should match the jar class files generated in internal_rules.gni
_DEVICE_CLASS_FILE_SUFFIX = 'device_filter.jar' _DEVICE_CLASS_EXCLUDE_SUFFIX = 'host_filter.jar'
_HOST_CLASS_FILE_SUFFIX = 'host_filter.jar' _HOST_CLASS_EXCLUDE_SUFFIX = 'device_filter.jar'
def _GenerateReportOutputArgs(args, def _GenerateReportOutputArgs(args,
class_files, class_files,
class_jar_suffix, class_jar_exclude,
report_name=None, report_name=None,
report_file=None): report_file=None):
cmd = _CreateClassfileArgs(class_files, class_jar_suffix) cmd = _CreateClassfileArgs(class_files, class_jar_exclude)
if args.format == 'html': if args.format == 'html':
report_dir = os.path.join(args.output_dir, report_name) report_dir = os.path.join(args.output_dir, report_name)
if not os.path.exists(report_dir): if not os.path.exists(report_dir):
...@@ -64,19 +64,19 @@ def _GenerateReportOutputArgs(args, ...@@ -64,19 +64,19 @@ def _GenerateReportOutputArgs(args,
return cmd return cmd
def _CreateClassfileArgs(class_files, suffix): def _CreateClassfileArgs(class_files, exclude_suffix):
"""Returns a list of files that don't have a given suffix. """Returns a list of files that don't have a given suffix.
Args: Args:
class_files: A list of class files. class_files: A list of class files.
suffix: Suffix to look for. exclude_suffix: Suffix to look for to exclude.
Returns: Returns:
A list of files that don't use the suffix. A list of files that don't use the suffix.
""" """
result_class_files = [] result_class_files = []
for f in class_files: for f in class_files:
if not f.endswith(suffix): if not f.endswith(exclude_suffix):
result_class_files += ['--classfiles', f] result_class_files += ['--classfiles', f]
return result_class_files return result_class_files
...@@ -216,10 +216,10 @@ def main(): ...@@ -216,10 +216,10 @@ def main():
junit_coverage_file = args.output_junit_coverage_file junit_coverage_file = args.output_junit_coverage_file
device_cmd = cmd + _GenerateReportOutputArgs( device_cmd = cmd + _GenerateReportOutputArgs(
args, class_files, _DEVICE_CLASS_FILE_SUFFIX, 'device_report', args, class_files, _DEVICE_CLASS_EXCLUDE_SUFFIX, 'device_report',
temp_device_file) temp_device_file)
host_cmd = cmd + _GenerateReportOutputArgs( host_cmd = cmd + _GenerateReportOutputArgs(
args, class_files, _HOST_CLASS_FILE_SUFFIX, 'host_report', args, class_files, _HOST_CLASS_EXCLUDE_SUFFIX, 'host_report',
temp_host_file) temp_host_file)
device_exit_code = cmd_helper.RunCmd(device_cmd) device_exit_code = cmd_helper.RunCmd(device_cmd)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment