Skip to content

Commit f2e1c22

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 f206af6 commit f2e1c22

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
@@ -203,7 +203,7 @@ check: test
203203
# in place
204204
coverage-clean:
205205
$(RM) -r node_modules
206-
$(RM) -r gcovr build
206+
$(RM) -r gcovr
207207
$(RM) -r coverage/tmp
208208
$(FIND) out/$(BUILDTYPE)/obj.target \( -name "*.gcda" -o -name "*.gcno" \) \
209209
-type f -exec $(RM) {} \;
@@ -219,13 +219,7 @@ coverage: coverage-test ## Run the tests and generate a coverage report.
219219
.PHONY: coverage-build
220220
coverage-build: all
221221
-$(MAKE) coverage-build-js
222-
if [ ! -d gcovr ]; then git clone -b 3.4 --depth=1 \
223-
--single-branch https://github.com/gcovr/gcovr.git; fi
224-
if [ ! -d build ]; then git clone --depth=1 \
225-
--single-branch https://github.com/nodejs/build.git; fi
226-
if [ ! -f gcovr/scripts/gcovr.orig ]; then \
227-
(cd gcovr && patch -N -p1 < \
228-
"$(CURDIR)/build/jenkins/scripts/coverage/gcovr-patches-3.4.diff"); fi
222+
if [ ! -d gcovr ]; then $(PYTHON) -m pip install -t gcovr gcovr==4.2; fi
229223
$(MAKE)
230224

231225
.PHONY: coverage-build-js
@@ -237,16 +231,14 @@ coverage-build-js:
237231

238232
.PHONY: coverage-test
239233
coverage-test: coverage-build
240-
$(RM) out/$(BUILDTYPE)/obj.target/node/src/*.gcda
241-
$(RM) out/$(BUILDTYPE)/obj.target/node/src/*/*.gcda
242-
$(RM) out/$(BUILDTYPE)/obj.target/node_lib/src/*.gcda
243-
$(RM) out/$(BUILDTYPE)/obj.target/node_lib/src/*/*.gcda
234+
$(FIND) out/$(BUILDTYPE)/obj.target -name "*.gcda" -type f -exec $(RM) {} \;
244235
-NODE_V8_COVERAGE=coverage/tmp \
245236
TEST_CI_ARGS="$(TEST_CI_ARGS) --type=coverage" $(MAKE) $(COVTESTS)
246237
$(MAKE) coverage-report-js
247-
-(cd out && "../gcovr/scripts/gcovr" \
238+
-(cd out && PYTHONPATH=../gcovr $(PYTHON) -m gcovr \
248239
--gcov-exclude='.*\b(deps|usr|out|cctest|embedding)\b' -v \
249-
-r Release/obj.target --html --html-detail -o ../coverage/cxxcoverage.html \
240+
-r ../src/ --object-directory Release/obj.target \
241+
--html --html-details -o ../coverage/cxxcoverage.html \
250242
--gcov-executable="$(GCOV)")
251243
@printf "Javascript coverage %%: "
252244
@grep -B1 Lines coverage/index.html | head -n1 \

0 commit comments

Comments
 (0)