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

Unified Diff: build/common.gypi

Issue 56136: Start of code coverage for Mac.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/chrome.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/common.gypi
===================================================================
--- build/common.gypi (revision 13066)
+++ build/common.gypi (working copy)
@@ -25,6 +25,12 @@
# Override branding to select the desired branding flavor.
'branding%': 'Chromium',
+
+ # Set to 1 to enable code coverage. In addition to build changes
+ # (e.g. extra CFLAGS), also creates a new target in the src/chrome
+ # project file called "coverage".
+ # Currently ignored on Windows.
+ 'coverage%': 0,
},
'target_defaults': {
'conditions': [
@@ -33,6 +39,35 @@
}, { # else: branding!="Chrome"
'defines': ['CHROMIUM_BUILD'],
}],
+ ['coverage!=0', {
+ 'conditions': [
+ ['OS=="mac"', {
+ 'xcode_settings': {
+ 'GCC_INSTRUMENT_PROGRAM_FLOW_ARCS': 'YES',
+ 'GCC_GENERATE_TEST_COVERAGE_FILES': 'YES',
+ },
+ # Add -lgcov for executables, not for static_libraries.
+ # This is a delayed conditional.
+ 'target_conditions': [
+ ['_type=="executable"', {
+ 'xcode_settings': { 'OTHER_LDFLAGS': [ '-lgcov' ] },
+ }],
+ ],
+ }],
+ # TODO(jrg): complete this work once Linux transitions to gyp.
+ # This is untested (--> likely doesn't work).
+ ['OS=="linux"', {
+ 'cflags': [ '-ftest-coverage',
+ '-fprofile-arcs' ],
+ 'target_conditions': [
+ ['_type=="executable"', {
+ 'link_settings': { 'libraries': [ '-lgcov' ] },
+ }],
+ ],
+ }],
+ ]},
+ # TODO(jrg): options for code coverage on Windows
+ ],
],
'default_configuration': 'Debug',
'configurations': {
« no previous file with comments | « no previous file | chrome/chrome.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698