forked from xapi-project/xenopsd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.coverage.sh
31 lines (24 loc) · 816 Bytes
/
.coverage.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh
set -ex
COVERAGE_DIR=.coverage
rm -rf $COVERAGE_DIR
mkdir -p $COVERAGE_DIR
pushd $COVERAGE_DIR
if [ -z "$KEEP" ]; then trap "popd; rm -rf $COVERAGE_DIR" EXIT; fi
$(which cp) -r ../* .
opam pin add bisect_ppx 1.3.0 -y
opam install ocveralls -y
export BISECT_ENABLE=YES
jbuilder runtest
outs=$(find . | grep bisect.*.out)
bisect-ppx-report -I $(dirname $outs[1]) -text report $outs
bisect-ppx-report -I $(dirname $outs[1]) -summary-only -text summary $outs
if [ -n "$HTML" ]; then bisect-ppx-report -I $(dirname $outs[1]) -html ../html-report $outs; fi
if [ -n "$TRAVIS" ]; then
echo "\$TRAVIS set; running ocveralls and sending to coveralls.io..."
ocveralls --prefix _build/default $outs --send
else
echo "\$TRAVIS not set; displaying results of bisect-report..."
cat report
cat summary
fi