The Wayback Machine - https://web.archive.org/web/20250407172853/https://github.com/nodejs/node/commit/5c0d82bae6
Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Commit 5c0d82b

Browse filesBrowse files
CurryKittenMylesBorins
authored andcommitted
build: Add option to compile for coverage reports
Add --coverage option to configure to support compiling for generation of C based coverage reports PR-URL: #9463 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
1 parent ee09828 commit 5c0d82b
Copy full SHA for 5c0d82b

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

‎configure

Copy file name to clipboardexpand all lines: configure
+10
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ parser.add_option('--prefix',
5959
default='/usr/local',
6060
help='select the install prefix [default: %default]')
6161

62+
parser.add_option('--coverage',
63+
action='store_true',
64+
dest='coverage',
65+
help='Build node with code coverage enabled')
66+
6267
parser.add_option('--debug',
6368
action='store_true',
6469
dest='debug',
@@ -863,6 +868,11 @@ def configure_node(o):
863868
if options.use_xcode and options.use_ninja:
864869
raise Exception('--xcode and --ninja cannot be used together.')
865870

871+
if options.coverage:
872+
o['variables']['coverage'] = 'true'
873+
else:
874+
o['variables']['coverage'] = 'false'
875+
866876
def configure_library(lib, output):
867877
shared_lib = 'shared_' + lib
868878
output['variables']['node_' + shared_lib] = b(getattr(options, shared_lib))

‎node.gyp

Copy file name to clipboardexpand all lines: node.gyp
+12-1
Original file line numberDiff line numberDiff line change
@@ -547,11 +547,22 @@
547547
'NODE_PLATFORM="sunos"',
548548
],
549549
}],
550-
[ '(OS=="freebsd" or OS=="linux") and node_shared=="false"', {
550+
[ '(OS=="freebsd" or OS=="linux") and node_shared=="false" and coverage=="false"', {
551551
'ldflags': [ '-Wl,-z,noexecstack',
552552
'-Wl,--whole-archive <(V8_BASE)',
553553
'-Wl,--no-whole-archive' ]
554554
}],
555+
[ '(OS=="freebsd" or OS=="linux") and node_shared=="false" and coverage=="true"', {
556+
'ldflags': [ '-Wl,-z,noexecstack',
557+
'-Wl,--whole-archive <(V8_BASE)',
558+
'-Wl,--no-whole-archive',
559+
'--coverage',
560+
'-g',
561+
'-O0' ],
562+
'cflags': [ '--coverage',
563+
'-g',
564+
'-O0' ]
565+
}],
555566
[ 'OS=="sunos"', {
556567
'ldflags': [ '-Wl,-M,/usr/lib/ld/map.noexstk' ],
557568
}],

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.