diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2016-02-19 15:31:29 +0200 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2016-02-19 17:40:30 +0200 |
commit | 6792d789521a104f78a9a702672672387831d78c (patch) | |
tree | e068269e371e6847f53739105aa44d80443a09e7 /gyp | |
parent | 6a2d910ccdb8a2521e1dbe4617e5bbdddb6cc4eb (diff) | |
download | qtlocation-mapboxgl-6792d789521a104f78a9a702672672387831d78c.tar.gz |
[tests] Use ENABLE_COVERAGE=1 envvar to enable coverage
This detaches coverage data collection from typical debug build.
Diffstat (limited to 'gyp')
-rw-r--r-- | gyp/common.gypi | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/gyp/common.gypi b/gyp/common.gypi index 685242057b..13565b04e6 100644 --- a/gyp/common.gypi +++ b/gyp/common.gypi @@ -97,8 +97,12 @@ '-fno-common', '--coverage', ], - 'ldflags': [ - '--coverage', + 'conditions': [ + ['enable_coverage=="1"', { + 'cflags_cc': [ '<@(cflags_cc)', '--coverage' ], + }, { + 'ldflags': [ '--coverage' ], + }], ], 'defines': [ 'DEBUG' ], 'xcode_settings': { @@ -106,10 +110,15 @@ 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'YES', 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES', 'DEAD_CODE_STRIPPING': 'NO', - 'GCC_INSTRUMENT_PROGRAM_FLOW_ARCS': 'YES', - 'GCC_GENERATE_TEST_COVERAGE_FILES': 'YES', - 'OTHER_CPLUSPLUSFLAGS': [ '-fno-omit-frame-pointer','-fwrapv', '-fstack-protector-all', '-fno-common', '-fprofile-arcs', '-ftest-coverage' ], - } + 'OTHER_CPLUSPLUSFLAGS': [ '-fno-omit-frame-pointer','-fwrapv', '-fstack-protector-all', '-fno-common' ], + 'conditions': [ + ['enable_coverage=="1"', { + 'GCC_INSTRUMENT_PROGRAM_FLOW_ARCS': 'YES', + 'GCC_GENERATE_TEST_COVERAGE_FILES': 'YES', + 'OTHER_CPLUSPLUSFLAGS': [ '<@(OTHER_CPLUSPLUSFLAGS)', '-fprofile-arcs', '-ftest-coverage' ], + }], + ], + }, }, 'Release': { 'cflags_cc': [ '-g', '-O3' ], |