test: exclude write-coverage from coverage report

Added a .nyrc configuration file that can be used to configure
test coverage.

Added an exclude rule that removes write-coverage.js from coverage
reports.

Pulled reporter configuration into .nycrc and added an additional
text reporter.

PR-URL: https://github.com/nodejs/node/pull/15194
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
Benjamin Coe 2017-09-04 23:33:27 -07:00 committed by Ruben Bridgewater
parent 9168b8cf47
commit e9442d1582
No known key found for this signature in database
GPG Key ID: F07496B3EB3C1762
3 changed files with 8 additions and 1 deletions

1
.gitignore vendored
View File

@ -12,6 +12,7 @@
!.gitignore
!.gitkeep
!.mailmap
!.nycrc
!.remarkrc
core

6
.nycrc Normal file
View File

@ -0,0 +1,6 @@
{
"exclude": [
"**/internal/process/write-coverage.js"
],
"reporter": ["html", "text"]
}

View File

@ -166,7 +166,7 @@ coverage-test: coverage-build
$(NODE) ./node_modules/.bin/istanbul-merge --out \
.cov_tmp/libcov.json 'out/Release/.coverage/coverage-*.json'
(cd lib && .$(NODE) ../node_modules/.bin/nyc report \
--temp-directory "$(CURDIR)/.cov_tmp" -r html \
--temp-directory "$(CURDIR)/.cov_tmp" \
--report-dir "../coverage")
-(cd out && "../gcovr/scripts/gcovr" --gcov-exclude='.*deps' \
--gcov-exclude='.*usr' -v -r Release/obj.target/node \