@@ -204,7 +204,7 @@ check: test
204204# in place
205205coverage-clean :
206206 $(RM ) -r node_modules
207- $(RM ) -r gcovr build
207+ $(RM ) -r gcovr
208208 $(RM ) -r coverage/tmp
209209 $(FIND ) out/$(BUILDTYPE ) /obj.target \( -name " *.gcda" -o -name " *.gcno" \) \
210210 -type f -exec $(RM ) {} \;
@@ -220,13 +220,7 @@ coverage: coverage-test ## Run the tests and generate a coverage report.
220220.PHONY : coverage-build
221221coverage-build : all
222222 -$(MAKE ) coverage-build-js
223- if [ ! -d gcovr ]; then git clone -b 3.4 --depth=1 \
224- --single-branch https://github.com/gcovr/gcovr.git; fi
225- if [ ! -d build ]; then git clone --depth=1 \
226- --single-branch https://github.com/nodejs/build.git; fi
227- if [ ! -f gcovr/scripts/gcovr.orig ]; then \
228- (cd gcovr && patch -N -p1 < \
229- " $( CURDIR) /build/jenkins/scripts/coverage/gcovr-patches-3.4.diff" ); fi
223+ if [ ! -d gcovr ]; then $( PYTHON) -m pip install -t gcovr gcovr==4.2; fi
230224 $(MAKE )
231225
232226.PHONY : coverage-build-js
@@ -238,16 +232,14 @@ coverage-build-js:
238232
239233.PHONY : coverage-test
240234coverage-test : coverage-build
241- $(RM ) out/$(BUILDTYPE ) /obj.target/node/src/* .gcda
242- $(RM ) out/$(BUILDTYPE ) /obj.target/node/src/* /* .gcda
243- $(RM ) out/$(BUILDTYPE ) /obj.target/node_lib/src/* .gcda
244- $(RM ) out/$(BUILDTYPE ) /obj.target/node_lib/src/* /* .gcda
235+ $(FIND ) out/$(BUILDTYPE ) /obj.target -name " *.gcda" -type f -exec $(RM ) {} \;
245236 -NODE_V8_COVERAGE=coverage/tmp \
246237 TEST_CI_ARGS=" $( TEST_CI_ARGS) --type=coverage" $(MAKE ) $(COVTESTS )
247238 $(MAKE ) coverage-report-js
248- -(cd out && " ../gcovr/scripts/ gcovr" \
239+ -(cd out && PYTHONPATH= ../gcovr $( PYTHON ) -m gcovr \
249240 --gcov-exclude=' .*\b(deps|usr|out|cctest|embedding)\b' -v \
250- -r Release/obj.target --html --html-detail -o ../coverage/cxxcoverage.html \
241+ -r ../src/ --object-directory Release/obj.target \
242+ --html --html-details -o ../coverage/cxxcoverage.html \
251243 --gcov-executable=" $( GCOV) " )
252244 @printf " Javascript coverage %%: "
253245 @grep -B1 Lines coverage/index.html | head -n1 \
847839ifeq ($(findstring powerpc,$(shell uname -p) ) ,powerpc)
848840DESTCPU ?= ppc64
849841else
842+ ifeq ($(findstring riscv64,$(UNAME_M ) ) ,riscv64)
843+ DESTCPU ?= riscv64
844+ else
850845DESTCPU ?= x86
851846endif
852847endif
@@ -857,6 +852,7 @@ endif
857852endif
858853endif
859854endif
855+ endif
860856ifeq ($(DESTCPU ) ,x64)
861857ARCH =x64
862858else
878874ifeq ($(DESTCPU ) ,s390x)
879875ARCH =s390x
880876else
877+ ifeq ($(DESTCPU ) ,riscv64)
878+ ARCH =riscv64
879+ else
881880ARCH =x86
882881endif
883882endif
@@ -886,6 +885,7 @@ endif
886885endif
887886endif
888887endif
888+ endif
889889
890890# node and v8 use different arch names (e.g. node 'x86' vs v8 'ia32').
891891# pass the proper v8 arch name to $V8_ARCH based on user-specified $DESTCPU.
@@ -1093,7 +1093,7 @@ $(TARBALL): release-only doc-only
10931093 find $(TARNAME ) /deps/v8/test -type f ! -regex ' .*/test/torque/.*' | xargs $(RM )
10941094 find $(TARNAME ) /deps/zlib/contrib/* -type d ! -regex ' .*/contrib/optimizations$$' | xargs $(RM ) -r
10951095 find $(TARNAME ) / -name " .eslint*" -maxdepth 2 | xargs $(RM )
1096- find $(TARNAME ) / -type l | xargs $(RM ) # annoying on windows
1096+ find $(TARNAME ) / -type l | xargs $(RM )
10971097 tar -cf $(TARNAME ) .tar $(TARNAME )
10981098 $(RM ) -r $(TARNAME )
10991099 gzip -c -f -9 $(TARNAME ) .tar > $(TARNAME ) .tar.gz
0 commit comments