[test] Add sanitizer coverage to gyp configs.

BUG=chromium:489254
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#28663}
This commit is contained in:
machenbach 2015-05-27 09:18:22 -07:00 committed by Commit bot
parent 92855aed25
commit a814516a08

View File

@ -76,6 +76,10 @@
'lsan%': 0,
'msan%': 0,
'tsan%': 0,
# Enable coverage gathering instrumentation in sanitizer tools. This flag
# also controls coverage granularity (1 for function-level, 2 for
# block-level, 3 for edge-level).
'sanitizer_coverage%': 0,
# goma settings.
# 1 to use goma.
@ -101,6 +105,7 @@
'lsan%': '<(lsan)',
'msan%': '<(msan)',
'tsan%': '<(tsan)',
'sanitizer_coverage%': '<(sanitizer_coverage)',
# Add a simple extra solely for the purpose of the cctests
'v8_extra_library_files': ['../test/cctest/test-extra.js'],
@ -321,7 +326,6 @@
}],
],
}],
# TODO(machenbach): Add sanitizer coverage.
['lsan==1', {
'target_conditions': [
['_toolset=="target"', {
@ -377,35 +381,64 @@
'<(DEPTH)/buildtools/third_party/libc++/libc++.gyp:libcxx_proxy',
],
}],
],
},
}],
['asan==1 and OS=="mac"', {
'target_defaults': {
'xcode_settings': {
'OTHER_CFLAGS+': [
'-fno-omit-frame-pointer',
'-gline-tables-only',
'-fsanitize=address',
'-w', # http://crbug.com/162783
],
'OTHER_CFLAGS!': [
'-fomit-frame-pointer',
],
'defines': [
'ADDRESS_SANITIZER',
],
},
'target_conditions': [
['_type!="static_library"', {
'xcode_settings': {'OTHER_LDFLAGS': ['-fsanitize=address']},
['sanitizer_coverage!=0', {
'target_conditions': [
['_toolset=="target"', {
'cflags': [
'-fsanitize-coverage=<(sanitizer_coverage)',
],
'defines': [
'SANITIZER_COVERAGE',
],
}],
],
}],
],
'dependencies': [
'<(DEPTH)/build/mac/asan.gyp:asan_dynamic_runtime',
],
},
}],
['OS=="mac"', {
'target_defaults': {
'conditions': [
['asan==1', {
'xcode_settings': {
# FIXME(machenbach): This is outdated compared to common.gypi.
'OTHER_CFLAGS+': [
'-fno-omit-frame-pointer',
'-gline-tables-only',
'-fsanitize=address',
'-w', # http://crbug.com/162783
],
'OTHER_CFLAGS!': [
'-fomit-frame-pointer',
],
'defines': [
'ADDRESS_SANITIZER',
],
},
'dependencies': [
'<(DEPTH)/build/mac/asan.gyp:asan_dynamic_runtime',
],
'target_conditions': [
['_type!="static_library"', {
'xcode_settings': {'OTHER_LDFLAGS': ['-fsanitize=address']},
}],
],
}],
['sanitizer_coverage!=0', {
'target_conditions': [
['_toolset=="target"', {
'cflags': [
'-fsanitize-coverage=<(sanitizer_coverage)',
],
'defines': [
'SANITIZER_COVERAGE',
],
}],
],
}],
],
}, # target_defaults
}], # OS=="mac"
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
or OS=="netbsd" or OS=="aix"', {
'target_defaults': {