Skip to content

Commit

Permalink
when you specify the environment variable FULL_CODE_COVERAGE=1, the s…
Browse files Browse the repository at this point in the history
…ubsequent `make` runs will include extensive code coverage analysis runs, next to the regular tests, etc.: a total summary will be available in the jison::/coverage/ directory when all is done.

Example command:

```sh
$ node_modules/.bin/cross-env FULL_CODE_COVERAGE=1 make examples
```
  • Loading branch information
GerHobbelt committed Dec 23, 2017
1 parent ac5ae87 commit 8ca92ef
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 88 deletions.
17 changes: 12 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ BABEL = node_modules/.bin/babel
MOCHA = node_modules/.bin/mocha
NYC = node_modules/.bin/nyc --clean=false --temp-directory ./.nyc_output

JISON = node dist/cli-cjs-es5.js
ifndef FULL_CODE_COVERAGE
JISON = node dist/cli-cjs-es5.js
else
JISON = $(NYC) --reporter=lcov -- node dist/cli-cjs-es5.js
endif



all: build test test-nyc examples-test
all: clean-nyc build test test-nyc examples-test

everything: \
clean \
Expand Down Expand Up @@ -79,10 +83,13 @@ check-coverage:

dynamic-analysis: analyze-coverage check-coverage

test-nyc:
clean-nyc:
# clear the coverage cache, etc.
-rm -rf ./.nyc_output
-rm -rf ./coverage/

test-nyc:
# DO NOT clear the coverage cache, etc.: earlier build tasks MAY also have contributed coverage info!
cd packages/helpers-lib && make test-nyc
cd packages/lex-parser && make test-nyc
cd packages/jison-lex && make test-nyc
Expand Down Expand Up @@ -592,6 +599,6 @@ superclean: clean clean-site
git-tag subpackages-git-tag \
compile-site clean-site \
publish subpackages-publish \
npm-update subpackages-npm-update \
test-nyc
npm-update subpackages-npm-update \
test-nyc clean-nyc

Loading

0 comments on commit 8ca92ef

Please sign in to comment.