Commit ce47fc8b authored by jkummerow's avatar jkummerow Committed by Commit bot

[build system] Support code coverage.

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

Cr-Commit-Position: refs/heads/master@{#32743}
parent 515d9ccd
...@@ -67,11 +67,15 @@ ...@@ -67,11 +67,15 @@
'host_arch%': '<(host_arch)', 'host_arch%': '<(host_arch)',
'target_arch%': '<(host_arch)', 'target_arch%': '<(host_arch)',
'base_dir%': '<!(cd <(DEPTH) && python -c "import os; print os.getcwd()")', 'base_dir%': '<!(cd <(DEPTH) && python -c "import os; print os.getcwd()")',
# Instrument for code coverage with gcov.
'coverage%': 0,
}, },
'base_dir%': '<(base_dir)', 'base_dir%': '<(base_dir)',
'host_arch%': '<(host_arch)', 'host_arch%': '<(host_arch)',
'target_arch%': '<(target_arch)', 'target_arch%': '<(target_arch)',
'v8_target_arch%': '<(target_arch)', 'v8_target_arch%': '<(target_arch)',
'coverage%': '<(coverage)',
'asan%': 0, 'asan%': 0,
'lsan%': 0, 'lsan%': 0,
'msan%': 0, 'msan%': 0,
...@@ -105,6 +109,7 @@ ...@@ -105,6 +109,7 @@
# If no gomadir is set, it uses the default gomadir. # If no gomadir is set, it uses the default gomadir.
'use_goma%': 0, 'use_goma%': 0,
'gomadir%': '', 'gomadir%': '',
'conditions': [ 'conditions': [
# Set default gomadir. # Set default gomadir.
['OS=="win"', { ['OS=="win"', {
...@@ -112,10 +117,11 @@ ...@@ -112,10 +117,11 @@
}, { }, {
'gomadir': '<!(/bin/echo -n ${HOME}/goma)', 'gomadir': '<!(/bin/echo -n ${HOME}/goma)',
}], }],
['host_arch!="ppc" and host_arch!="ppc64" and host_arch!="ppc64le"', { ['host_arch!="ppc" and host_arch!="ppc64" and host_arch!="ppc64le" and \
'host_clang%': '1', coverage==0', {
'host_clang%': 1,
}, { }, {
'host_clang%': '0', 'host_clang%': 0,
}], }],
# linux_use_bundled_gold: whether to use the gold linker binary checked # linux_use_bundled_gold: whether to use the gold linker binary checked
# into third_party/binutils. Force this off via GYP_DEFINES when you # into third_party/binutils. Force this off via GYP_DEFINES when you
...@@ -159,6 +165,7 @@ ...@@ -159,6 +165,7 @@
'cfi_blacklist%': '<(cfi_blacklist)', 'cfi_blacklist%': '<(cfi_blacklist)',
'test_isolation_mode%': '<(test_isolation_mode)', 'test_isolation_mode%': '<(test_isolation_mode)',
'fastbuild%': '<(fastbuild)', 'fastbuild%': '<(fastbuild)',
'coverage%': '<(coverage)',
# Add a simple extras solely for the purpose of the cctests # Add a simple extras solely for the purpose of the cctests
'v8_extra_library_files': ['../test/cctest/test-extra.js'], 'v8_extra_library_files': ['../test/cctest/test-extra.js'],
...@@ -220,7 +227,7 @@ ...@@ -220,7 +227,7 @@
'v8_enable_gdbjit%': 0, 'v8_enable_gdbjit%': 0,
}], }],
['(OS=="linux" or OS=="mac") and (target_arch=="ia32" or target_arch=="x64") and \ ['(OS=="linux" or OS=="mac") and (target_arch=="ia32" or target_arch=="x64") and \
(v8_target_arch!="x87" and v8_target_arch!="x32")', { (v8_target_arch!="x87" and v8_target_arch!="x32") and coverage==0', {
'clang%': 1, 'clang%': 1,
}, { }, {
'clang%': 0, 'clang%': 0,
...@@ -701,6 +708,11 @@ ...@@ -701,6 +708,11 @@
[ 'component=="shared_library"', { [ 'component=="shared_library"', {
'cflags': [ '-fPIC', ], 'cflags': [ '-fPIC', ],
}], }],
[ 'coverage==1', {
'cflags!': [ '-O3', '-O2', '-O1', ],
'cflags': [ '-fprofile-arcs', '-ftest-coverage', '-O0'],
'ldflags': [ '-fprofile-arcs'],
}],
], ],
}, },
}], }],
......
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