From f622771079a54dc3de640ae07b1e0e697e20c1f5 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Sat, 7 Sep 2019 22:20:17 +0200 Subject: [PATCH] build: improve `make coverage` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Run cleanup for all relevant subdirectories, and exclude generated source files (e.g. `out/Release/...`) from coverage reporting. Also enable running `make cctest` again (It’s unclear to me why this was disabled, as it does reduce coverage unnecessarily). PR-URL: https://github.com/nodejs/node/pull/29487 Reviewed-By: Rich Trott Reviewed-By: Colin Ihrig Reviewed-By: Benjamin Gruenbaum Reviewed-By: Jiawen Geng --- Makefile | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 33d43798f52617..a313406d92adf6 100644 --- a/Makefile +++ b/Makefile @@ -240,17 +240,15 @@ coverage-build-js: .PHONY: coverage-test coverage-test: coverage-build - $(RM) out/$(BUILDTYPE)/obj.target/node/gen/*.gcda $(RM) out/$(BUILDTYPE)/obj.target/node/src/*.gcda - $(RM) out/$(BUILDTYPE)/obj.target/node/src/tracing/*.gcda - $(RM) out/$(BUILDTYPE)/obj.target/node_lib/gen/*.gcda + $(RM) out/$(BUILDTYPE)/obj.target/node/src/*/*.gcda $(RM) out/$(BUILDTYPE)/obj.target/node_lib/src/*.gcda - $(RM) out/$(BUILDTYPE)/obj.target/node_lib/src/tracing/*.gcda + $(RM) out/$(BUILDTYPE)/obj.target/node_lib/src/*/*.gcda -NODE_V8_COVERAGE=out/$(BUILDTYPE)/.coverage \ TEST_CI_ARGS="$(TEST_CI_ARGS) --type=coverage" $(MAKE) $(COVTESTS) $(MAKE) coverage-report-js - -(cd out && "../gcovr/scripts/gcovr" --gcov-exclude='.*deps' \ - --gcov-exclude='.*usr' -v -r Release/obj.target \ + -(cd out && "../gcovr/scripts/gcovr" \ + --gcov-exclude='.*\b(deps|usr|out|cctest)\b' -v -r Release/obj.target \ --html --html-detail -o ../coverage/cxxcoverage.html \ --gcov-executable="$(GCOV)") @echo -n "Javascript coverage %: " @@ -335,7 +333,7 @@ test-cov: all $(MAKE) build-addons $(MAKE) build-js-native-api-tests $(MAKE) build-node-api-tests - # $(MAKE) cctest + $(MAKE) cctest CI_SKIP_TESTS=$(COV_SKIP_TESTS) $(MAKE) jstest test-parallel: all