Commit 7540893b authored by Zhaoyang Li's avatar Zhaoyang Li Committed by Commit Bot

[code coverage] Remove multiple sets of code coverage compiler flags.

The wrapper currently removes only one set of the flags for code
coverage partial instrumentation. But there can be situation where
multiple sets of same flags are in compile command and all of these need
to be removed.

Bug: 1137569
Change-Id: I32c48710fd9c0c66d7c218f329efcd222704607e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2466976
Commit-Queue: Zhaoyang Li <zhaoyangli@chromium.org>
Reviewed-by: default avatarYuke Liao <liaoyuke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#816694}
parent 09144e29
......@@ -91,7 +91,7 @@ _COVERAGE_EXCLUSION_LIST_MAP = {
'../../chrome/browser/media/router/providers/cast/cast_internal_message_util.cc', #pylint: disable=line-too-long
'../../components/cast_channel/cast_channel_enum.cc',
'../../components/cast_channel/cast_message_util.cc',
'../../components/media_router/common/providers/cast/cast_media_source.cc',
'../../components/media_router/common/providers/cast/cast_media_source.cc', #pylint: disable=line-too-long
'../../ui/events/keycodes/dom/keycode_converter.cc',
# TODO(crbug.com/1051561): angle_unittests affected by coverage.
'../../base/message_loop/message_pump_default.cc',
......@@ -145,10 +145,13 @@ def _remove_flags_from_command(command):
try:
while True:
idx = command.index(start_flag, start_idx)
start_idx = idx + 1
if command[idx:idx + num_flags] == _COVERAGE_FLAGS:
del command[idx:idx + num_flags]
break
# There can be multiple sets of _COVERAGE_FLAGS. All of these need to be
# removed.
start_idx = idx
else:
start_idx = idx + 1
except ValueError:
pass
......
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