Skip to content

Commit 4b948fd

Browse files
committed
working on making jison tests run under istanbul/nyc coverage analysis: code generation & injection is a tough cookie when it comes to instrumented code coverage analysis as we're running into several crashes. Added checkcode to help speed up the trail&fix cycle: before we compile any code, we check for code coverage artifacts in the submitted code and barf a hairball when we find any. Several finds have been fixed, but only in the dist/ files: these edits must still be migrated to the proper source files!
1 parent 0ca8a12 commit 4b948fd

File tree

10 files changed

+3047
-490
lines changed

10 files changed

+3047
-490
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,7 @@ Vagrantfile
4747
*.log
4848
*.patch
4949

50+
# istanbul / nyc code coverage analysis workspaces
51+
/.nyc_output
52+
/coverage
53+

Makefile

+16
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ NANOC := $(shell command -v nanoc 2> /dev/null)
44
ROLLUP = node_modules/.bin/rollup
55
BABEL = node_modules/.bin/babel
66
MOCHA = node_modules/.bin/mocha
7+
NYC = node_modules/.bin/nyc
8+
COVERALLS = node_modules/.bin/coveralls
79

810
JISON = node dist/cli-cjs-es5.js
911

@@ -70,6 +72,20 @@ deploy: site
7072
test:
7173
$(MOCHA) --timeout 18000 --check-leaks --globals assert --recursive tests/
7274

75+
analyze-coverage:
76+
istanbul cover test/unit-tests.js
77+
78+
check-coverage:
79+
istanbul check-coverage --statement 96 --branch 96 --function 96
80+
81+
dynamic-analysis: analyze-coverage check-coverage
82+
83+
test-nyc:
84+
$(NYC) --clean --reporter=lcov --reporter=text --exclude 'examples/issue-lex*.js' -- $(MOCHA) --timeout 18000 --check-leaks --globals assert --recursive tests/
85+
86+
coveralls:
87+
$(NYC) report --reporter=text-lcov | $(COVERALLS)
88+
7389
web-examples: web/content/assets/js/calculator.js
7490

7591
examples: examples_directory

0 commit comments

Comments
 (0)