From a243961a7e9dcca76c4078883fcc16268f1bfcf7 Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Fri, 2 Mar 2018 13:39:10 -0500 Subject: [PATCH] build: fix gocvr version used for coverage Fix the gcovr version to a fixed version and uses patches specific to that version. This avoids us being broken by changes in the gcovr repo. Using file name for patches specific to the version level will allow us to move up when necessary without breaking coverage for earlier versions of Node.js PR-URL: https://github.com/nodejs/node/pull/19094 Reviewed-By: Gibson Fahnestock --- Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 84f2f3fb28af66..e9afdc87e72758 100644 --- a/Makefile +++ b/Makefile @@ -172,13 +172,13 @@ coverage-build: all $(NODE) ./deps/npm install istanbul-merge --no-save --no-package-lock; fi if [ ! -d node_modules/nyc ]; then \ $(NODE) ./deps/npm install nyc --no-save --no-package-lock; fi - if [ ! -d gcovr ]; then git clone --depth=1 \ + if [ ! -d gcovr ]; then git clone -b 3.4 --depth=1 \ --single-branch git://github.com/gcovr/gcovr.git; fi if [ ! -d build ]; then git clone --depth=1 \ --single-branch https://github.com/nodejs/build.git; fi - if [ ! -f gcovr/gcovr/gcov.py.orig ]; then \ - (cd gcovr && patch -b -N -p1 < \ - "$(CURDIR)/build/jenkins/scripts/coverage/gcovr-patches.diff"); fi + if [ ! -f gcovr/scripts/gcovr.orig ]; then \ + (cd gcovr && patch -N -p1 < \ + "$(CURDIR)/build/jenkins/scripts/coverage/gcovr-patches-3.4.diff"); fi if [ -d lib_ ]; then $(RM) -r lib; mv lib_ lib; fi mv lib lib_ $(NODE) ./node_modules/.bin/nyc instrument --extension .js --extension .mjs lib_/ lib/ @@ -203,7 +203,7 @@ coverage-test: coverage-build (cd lib && .$(NODE) ../node_modules/.bin/nyc report \ --temp-directory "$(CURDIR)/.cov_tmp" \ --report-dir "../coverage") - -(cd out && PYTHONPATH=$(CURDIR)/gcovr $(PYTHON) -m gcovr --gcov-exclude='.*deps' \ + -(cd out && "../gcovr/scripts/gcovr" --gcov-exclude='.*deps' \ --gcov-exclude='.*usr' -v -r Release/obj.target \ --html --html-detail -o ../coverage/cxxcoverage.html \ --gcov-executable="$(GCOV)")