Skip to content

Commit

Permalink
[Android] Enable passing filter string to emma.
Browse files Browse the repository at this point in the history
This is needed to filter out upstream packages downstream.

BUG=None

Review URL: https://codereview.chromium.org/25814002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@227105 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
frankf@chromium.org committed Oct 4, 2013
1 parent 49e5374 commit 9662d92
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
19 changes: 12 additions & 7 deletions build/android/gyp/emma_instr.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ def _AddInstrumentOptions(option_parser):
help='Root of the src repository.')
option_parser.add_option('--emma-jar',
help='Path to emma.jar.')
option_parser.add_option(
'--filter-string', default='',
help=('Filter string consisting of a list of inclusion/exclusion '
'patterns separated with whitespace and/or comma.'))


def _RunCopyCommand(command, options, args, option_parser):
Expand Down Expand Up @@ -150,13 +154,14 @@ def _RunInstrumentCommand(command, options, args, option_parser):
options.sources_file)
temp_dir = tempfile.mkdtemp()
try:
# TODO(gkanwar): Add '-ix' option to filter out useless classes.
build_utils.CheckCallDie(['java', '-cp', options.emma_jar,
'emma', 'instr',
'-ip', options.input_path,
'-d', temp_dir,
'-out', coverage_file,
'-m', 'fullcopy'], suppress_output=True)
cmd = ['java', '-cp', options.emma_jar,
'emma', 'instr',
'-ip', options.input_path,
'-ix', options.filter_string,
'-d', temp_dir,
'-out', coverage_file,
'-m', 'fullcopy']
build_utils.CheckCallDie(cmd, suppress_output=True)

if command == 'instrument_jar':
for jar in os.listdir(os.path.join(temp_dir, 'lib')):
Expand Down
1 change: 1 addition & 0 deletions build/android/instr_action.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
'--sources=<(java_in_dir)/src >(additional_src_dirs) >(generated_src_dirs)',
'--src-root=<(DEPTH)',
'--emma-jar=<(emma_jar)',
'--filter-string=<(emma_filter)',
],
'conditions': [
['instr_type == "jar"', {
Expand Down
5 changes: 5 additions & 0 deletions build/common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,11 @@
# to produce .ec files during runtime.
'emma_coverage%': 0,

# EMMA filter string consisting of a list of inclusion/exclusion patterns
# separated with whitespace and/or comma. Only has effect if
# 'emma_coverage=1'.
'emma_filter%': '',

# Set to 1 to force Visual C++ to use legacy debug information format /Z7.
# This is useful for parallel compilation tools which can't support /Zi.
# Only used on Windows.
Expand Down

0 comments on commit 9662d92

Please sign in to comment.