From 3fbe442b7b681784990ff4b4811598cc2b8a6dad Mon Sep 17 00:00:00 2001 From: Alan Gutierrez Date: Wed, 10 Jan 2018 09:17:47 -0600 Subject: [PATCH] Use build utilities in `PATH`. --- .travis.yml | 2 +- t/cover | 15 +++++++++++++-- t/test | 8 +++++--- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index fbf3be0..2e73334 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,4 +14,4 @@ branches: before_install: - npm install - - npm install istanbul coveralls + - npm install -g istanbul coveralls diff --git a/t/cover b/t/cover index a997713..231559f 100755 --- a/t/cover +++ b/t/cover @@ -2,16 +2,27 @@ set -e +if ! which istanbul > /dev/null; then + cat << EOF 1>&2 + +Istanbul is required to run coverage. Install Istanbul: + + npm install istanbul + +EOF + exit 1 +fi + rm -rf coverage count=1; for file in $(find . ! -path '*/node_modules/*' -name \*.t.js); do - node_modules/.bin/istanbul cover -x 't/**' -x '*/t/**' $file > /dev/null 2>&1 + istanbul cover -x 't/**' -x '*/t/**' $file > /dev/null 2>&1 mv coverage/coverage.json coverage/coverage$count.json count=$(expr $count + 1) done -node_modules/.bin/istanbul report --root coverage --dir coverage > /dev/null +istanbul report --root coverage --dir coverage > /dev/null sed -i -e s,'^SF:'`pwd`/,SF:, coverage/lcov.info diff --git a/t/test b/t/test index a09a9c6..d372180 100755 --- a/t/test +++ b/t/test @@ -4,17 +4,19 @@ set -e echo "" -(proof run t/*.t.js | tee .proof.out | proof progress) || (proof errors < .proof.out) || exit 1 +(proof run t/*.t.js | tee .proof.out | proof progress) \ + || (proof errors < .proof.out) \ + || exit 1 if [ "$TRAVIS" = "true" ]; then echo "" echo "running with coverage" t/cover - node_modules/.bin/istanbul report --format text + istanbul report --format text echo "" echo "submitting to coveralls.io" - (cat coverage/lcov.info | node_modules/.bin/coveralls) > /dev/null 2>&1 + (cat coverage/lcov.info | coveralls) > /dev/null 2>&1 fi echo ""