1
0
Fork 0

[DEV-6721] Add optional code coverage

master
Austin Schaffer 2020-01-31 14:12:52 -05:00
parent 3c5cffc34f
commit e81516ca80
4 changed files with 22 additions and 5 deletions

View File

@ -3,12 +3,13 @@ image: $BUILD_IMAGE
stages:
- build
- deploy
- publish
build:
stage: build
script:
- autoreconf -fvi
- ./configure --with-srcuri="$SRCURI"
- ./configure --with-srcuri="$SRCURI" --enable-code-coverage
- npm install
- make all
- make info pdf html
@ -16,6 +17,7 @@ build:
artifacts:
paths:
- doc/
- coverage/
expire_in: 30 min
pages:
@ -23,9 +25,11 @@ pages:
script:
- mkdir -p public/doc
- mv doc/liza.html/* doc/liza.pdf doc/liza.info public/
- mkdir -p public/coverage
- mv coverage/* public/coverage
artifacts:
paths:
- public/
expire_in: 30 min
only:
- tags
- tags

View File

@ -67,10 +67,11 @@ check-ts-out:
test: check
check: $(tsout) check-ts-out
PATH="$(PATH):$(CURDIR)/node_modules/mocha/bin" \
mocha @NODE_DESTRUCTURE@ \
PATH="$(PATH):$(CURDIR)/node_modules/.bin" \
@CODE_COV@ mocha @NODE_DESTRUCTURE@ \
--require $(path_test)/pre.js \
--recursive \
@COV_ARGS@ \
$(TESTARGS)
FORCE:

View File

@ -79,6 +79,16 @@ AC_ARG_WITH(
AC_SUBST([SET_SRCURI], [$set_srcuri])
AC_ARG_ENABLE(
[code_coverage],
[AS_HELP_STRING([--enable-code-coverage],
[Generate a code coverage report when tests are run
(disabled by default)])],
AC_SUBST([CODE_COV], ["nyc --reporter=html --reporter=text --all --include=src \
--exclude=**/index.js --exclude=src/version.js"])
AC_SUBST([COV_ARGS], ["--require ts-node/register/transpile-only \
--require source-map-support/register"]))
AC_SUBST([AUTOGENERATED],
["THIS FILE IS AUTOGENERATED! DO NOT MODIFY! See *.in."])

View File

@ -43,7 +43,9 @@
"@types/mocha": "5.2.0",
"sinon": ">=1.17.4",
"es6-promise": "~3",
"@types/amqplib": "0.5.13"
"@types/amqplib": "0.5.13",
"nyc": "15.0.0",
"ts-node": "^8.6.2"
},
"licenses": [