Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1305)

Side by Side Diff: build/coverage_wrapper.py

Issue 1737263003: [coverage] Enable sanitizer coverage. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Documentation Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | build/standalone.gypi » ('j') | tools/sanitizers/sancov_formatter.py » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2016 the V8 project authors. All rights reserved. 2 # Copyright 2016 the V8 project authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 # CC/CXX wrapper script that excludes certain file patterns from coverage 6 # CC/CXX wrapper script that excludes certain file patterns from coverage
7 # instrumentation. 7 # instrumentation.
8 8
9 import re 9 import re
10 import subprocess 10 import subprocess
11 import sys 11 import sys
12 12
13 exclusions = [ 13 exclusions = [
14 'buildtools',
14 'src/third_party', 15 'src/third_party',
15 'third_party', 16 'third_party',
16 'test', 17 'test',
17 'testing', 18 'testing',
18 ] 19 ]
19 20
21 def remove_failsafe(l, item):
kjellander_chromium 2016/03/04 14:35:22 rename variable "l" to something more describing,
Michael Achenbach 2016/03/04 15:00:25 Done.
tandrii(chromium) 2016/03/07 15:10:22 nit: maybe remove_if_exists?
Michael Achenbach 2016/03/07 16:07:20 Done.
22 try:
23 l.remove(item)
24 except:
25 pass
26
20 args = sys.argv[1:] 27 args = sys.argv[1:]
21 text = ' '.join(sys.argv[2:]) 28 text = ' '.join(sys.argv[2:])
22 for exclusion in exclusions: 29 for exclusion in exclusions:
23 if re.search(r'\-o obj/%s[^ ]*\.o' % exclusion, text): 30 if re.search(r'\-o obj/%s[^ ]*\.o' % exclusion, text):
24 args.remove('-fprofile-arcs') 31 remove_failsafe(args, '-fprofile-arcs')
25 args.remove('-ftest-coverage') 32 remove_failsafe(args, '-ftest-coverage')
33 remove_failsafe(args, '-fsanitize-coverage=func')
34 remove_failsafe(args, '-fsanitize-coverage=bb')
35 remove_failsafe(args, '-fsanitize-coverage=edge')
26 break 36 break
27 37
28 sys.exit(subprocess.check_call(args)) 38 sys.exit(subprocess.check_call(args))
OLDNEW
« no previous file with comments | « no previous file | build/standalone.gypi » ('j') | tools/sanitizers/sancov_formatter.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698