Skip to content

Commit 1bd44d7

Browse files
mhdawsonjasnell
authored andcommitted
build: fix coverage generation
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>
1 parent 3f292bf commit 1bd44d7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Makefile

+4-3
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ coverage: coverage-test ## Run the tests and generate a coverage report.
203203
coverage-build: all
204204
mkdir -p node_modules
205205
if [ ! -d node_modules/nyc ]; then \
206-
$(NODE) ./deps/npm install nyc --no-save --no-package-lock; fi
206+
$(NODE) ./deps/npm install nyc@13 --no-save --no-package-lock; fi
207207
if [ ! -d gcovr ]; then git clone -b 3.4 --depth=1 \
208208
--single-branch git://github.com/gcovr/gcovr.git; fi
209209
if [ ! -d build ]; then git clone --depth=1 \
@@ -234,8 +234,9 @@ coverage-test: coverage-build
234234
$(NODE) ./node_modules/.bin/nyc merge 'out/Release/.coverage' \
235235
.cov_tmp/libcov.json
236236
(cd lib && .$(NODE) ../node_modules/.bin/nyc report \
237-
--temp-directory "$(CURDIR)/.cov_tmp" \
238-
--report-dir "$(CURDIR)/coverage")
237+
--temp-dir "$(CURDIR)/.cov_tmp" \
238+
--report-dir "$(CURDIR)/coverage" \
239+
--reporter html)
239240
-(cd out && "../gcovr/scripts/gcovr" --gcov-exclude='.*deps' \
240241
--gcov-exclude='.*usr' -v -r Release/obj.target \
241242
--html --html-detail -o ../coverage/cxxcoverage.html \

0 commit comments

Comments
 (0)