diff --git a/Makefile b/Makefile index 003c69579bcee0..6ccce30085b1a9 100644 --- a/Makefile +++ b/Makefile @@ -191,6 +191,9 @@ coverage-test: coverage-build $(RM) out/$(BUILDTYPE)/obj.target/node/gen/*.gcda $(RM) out/$(BUILDTYPE)/obj.target/node/src/*.gcda $(RM) out/$(BUILDTYPE)/obj.target/node/src/tracing/*.gcda + $(RM) out/$(BUILDTYPE)/obj.target/node_lib/gen/*.gcda + $(RM) out/$(BUILDTYPE)/obj.target/node_lib/src/*.gcda + $(RM) out/$(BUILDTYPE)/obj.target/node_lib/src/tracing/*.gcda -$(MAKE) $(COVTESTS) mv lib lib__ mv lib_ lib @@ -201,7 +204,7 @@ coverage-test: coverage-build --temp-directory "$(CURDIR)/.cov_tmp" \ --report-dir "../coverage") -(cd out && "../gcovr/scripts/gcovr" --gcov-exclude='.*deps' \ - --gcov-exclude='.*usr' -v -r Release/obj.target/node \ + --gcov-exclude='.*usr' -v -r Release/obj.target \ --html --html-detail -o ../coverage/cxxcoverage.html \ --gcov-executable="$(GCOV)") mv lib lib_ diff --git a/node.gypi b/node.gypi index 49384db0a5ddb5..d01004ce8cc449 100644 --- a/node.gypi +++ b/node.gypi @@ -184,25 +184,20 @@ ], }], [ '(OS=="freebsd" or OS=="linux") and node_shared=="false"' - ' and coverage=="false" and force_load=="true"', { + ' and force_load=="true"', { 'ldflags': [ '-Wl,-z,noexecstack', '-Wl,--whole-archive <(v8_base)', '-Wl,--no-whole-archive' ] }], - [ '(OS=="freebsd" or OS=="linux") and node_shared=="false"' - ' and coverage=="true" and force_load=="true"', { - 'ldflags': [ '-Wl,-z,noexecstack', - '-Wl,--whole-archive <(v8_base)', - '-Wl,--no-whole-archive', - '--coverage', + [ 'OS in "mac freebsd linux" and node_shared=="false"' + ' and coverage=="true"', { + 'ldflags': [ '--coverage', '-g', '-O0' ], - 'cflags': [ '--coverage', + 'cflags': [ '--coverage', '-g', '-O0' ], - 'cflags!': [ '-O3' ] - }], - [ 'OS=="mac" and node_shared=="false" and coverage=="true"', { + 'cflags!': [ '-O3' ], 'xcode_settings': { 'OTHER_LDFLAGS': [ '--coverage',