Skip to content

Commit

Permalink
build: fix coverage generation
Browse files Browse the repository at this point in the history
Changes in command line options for nyc resulted in the
coverage target no longer working.

Pin the major version of nyc and update the options to
get it working again.

PR-URL: #23769
Fixes: #23690
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: George Adams <george.adams@uk.ibm.com>
  • Loading branch information
mhdawson authored and jasnell committed Oct 22, 2018
1 parent 3f292bf commit 1bd44d7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ coverage: coverage-test ## Run the tests and generate a coverage report.
coverage-build: all
mkdir -p node_modules
if [ ! -d node_modules/nyc ]; then \
$(NODE) ./deps/npm install nyc --no-save --no-package-lock; fi
$(NODE) ./deps/npm install nyc@13 --no-save --no-package-lock; fi
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 \
Expand Down Expand Up @@ -234,8 +234,9 @@ coverage-test: coverage-build
$(NODE) ./node_modules/.bin/nyc merge 'out/Release/.coverage' \
.cov_tmp/libcov.json
(cd lib && .$(NODE) ../node_modules/.bin/nyc report \
--temp-directory "$(CURDIR)/.cov_tmp" \
--report-dir "$(CURDIR)/coverage")
--temp-dir "$(CURDIR)/.cov_tmp" \
--report-dir "$(CURDIR)/coverage" \
--reporter html)
-(cd out && "../gcovr/scripts/gcovr" --gcov-exclude='.*deps' \
--gcov-exclude='.*usr' -v -r Release/obj.target \
--html --html-detail -o ../coverage/cxxcoverage.html \
Expand Down

0 comments on commit 1bd44d7

Please sign in to comment.