Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 36.4k
test: refactor coverage logic#35767
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -197,20 +197,11 @@ check: test | ||
| # Remove files generated by running coverage, put the non-instrumented lib back | ||
| # in place | ||
| coverage-clean: | ||
| if [ -d lib_ ]; then $(RM) -r lib; mv lib_ lib; fi | ||
| $(RM) -r node_modules | ||
| $(RM) -r gcovr build | ||
| $(RM) -r out/$(BUILDTYPE)/.coverage | ||
| $(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/gen/*.gcno | ||
| $(RM) out/$(BUILDTYPE)/obj.target/node/src/*.gcno | ||
| $(RM) out/$(BUILDTYPE)/obj.target/node/src/tracing/*.gcno | ||
| $(RM) out/$(BUILDTYPE)/obj.target/cctest/src/*.gcno | ||
| $(RM) out/$(BUILDTYPE)/obj.target/cctest/test/cctest/*.gcno | ||
| $(RM) out/$(BUILDTYPE)/obj.target/embedtest/src/*.gcno | ||
| $(RM) out/$(BUILDTYPE)/obj.target/embedtest/test/embedding/*.gcno | ||
| $(RM) -r coverage/tmp | ||
| $(FIND) out/$(BUILDTYPE)/obj.target \( -name "*.gcda" -o -name "*.gcno" \) \ | ||
| -type f -exec $(RM) {} \; | ||
| .PHONY: coverage | ||
| # Build and test with code coverage reporting. Leave the lib directory | ||
| @@ -245,8 +236,8 @@ coverage-test: coverage-build | ||
| $(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/*/*.gcda | ||
| -NODE_V8_COVERAGE=out/$(BUILDTYPE)/.coverage \ | ||
| TEST_CI_ARGS="$(TEST_CI_ARGS) --type=coverage" $(MAKE) $(COVTESTS) | ||
| -NODE_V8_COVERAGE=coverage/tmp \ | ||
| TEST_CI_ARGS="$(TEST_CI_ARGS) --type=coverage" $(MAKE) $(COVTESTS) | ||
| $(MAKE) coverage-report-js | ||
| -(cd out && "../gcovr/scripts/gcovr" \ | ||
| --gcov-exclude='.*\b(deps|usr|out|cctest|embedding)\b' -v \ | ||
| @@ -259,17 +250,10 @@ coverage-test: coverage-build | ||
| @grep -A3 Lines coverage/cxxcoverage.html | grep style \ | ||
| | sed 's/<[^>]*>//g'| sed 's/ //g' | ||
| COV_REPORT_OPTIONS = --reporter=html \ | ||
| --temp-directory=out/$(BUILDTYPE)/.coverage --omit-relative=false \ | ||
ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these options are encapsulated in the | ||
| --resolve=./lib --exclude="benchmark/" --exclude="deps/" --exclude="test/" --exclude="tools/" \ | ||
| --wrapper-length=0 | ||
| ifdef COV_ENFORCE_THRESHOLD | ||
| COV_REPORT_OPTIONS += --check-coverage --lines=$(COV_ENFORCE_THRESHOLD) | ||
| endif | ||
| .PHONY: coverage-report-js | ||
| coverage-report-js: | ||
| $(NODE) ./node_modules/.bin/c8 report $(COV_REPORT_OPTIONS) | ||
| -$(MAKE) coverage-build-js | ||
| $(NODE) ./node_modules/.bin/c8 report | ||
| .PHONY: cctest | ||
| # Runs the C++ tests using the built `cctest` executable. | ||
| @@ -305,9 +289,8 @@ tooltest: | ||
| .PHONY: coverage-run-js | ||
| coverage-run-js: | ||
| $(RM) -r out/$(BUILDTYPE)/.coverage | ||
| $(MAKE) coverage-build-js | ||
| -NODE_V8_COVERAGE=out/$(BUILDTYPE)/.coverage CI_SKIP_TESTS=$(COV_SKIP_TESTS) \ | ||
| $(RM) -r coverage/tmp | ||
| -NODE_V8_COVERAGE=coverage/tmp CI_SKIP_TESTS=$(COV_SKIP_TESTS) \ | ||
| TEST_CI_ARGS="$(TEST_CI_ARGS) --type=coverage" $(MAKE) jstest | ||
| $(MAKE) coverage-report-js | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can just set
NODE_V8_COVERAGE, and then run tests any which way.