Skip to content

Commit

Permalink
Use build utilities in PATH.
Browse files Browse the repository at this point in the history
  • Loading branch information
flatheadmill committed Jan 10, 2018
1 parent 0a60374 commit 3fbe442
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ branches:

before_install:
- npm install
- npm install istanbul coveralls
- npm install -g istanbul coveralls
15 changes: 13 additions & 2 deletions t/cover
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 5 additions & 3 deletions t/test
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""

0 comments on commit 3fbe442

Please sign in to comment.