Skip to content

Commit 1068182

Browse files
richardlautargos
authored andcommitted
build: update gcovr for gcc 8 compatibility
Update the version of `gcovr` used for C++ coverage from 3.4 to 4.2 for compatibility with gcc/g++ 8. PR-URL: #39326 Refs: #39303 Refs: gcovr/gcovr#228 Refs: nodejs/build#2705 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent cfd96aa commit 1068182

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

Makefile

+6-14
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ check: test
204204
# in place
205205
coverage-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
221221
coverage-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
240234
coverage-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 \

0 commit comments

Comments
 (0)