-
Notifications
You must be signed in to change notification settings - Fork 26
/
.coverage.sh
37 lines (28 loc) · 900 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
32
33
34
35
36
37
#!/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 ../* .
eval `opam config env`
opam install -y bisect_ppx oasis ocveralls ounit2
sed -i 's/BuildDepends:/BuildDepends: bisect_ppx,/g' _oasis
oasis setup
rm -f setup.data
./configure
make ENABLE_TESTS=--enable-tests
find . -name bisect* | xargs rm -f
./test.native -runner sequential
bisect-report bisect*.out -I _build -text report
bisect-report bisect*.out -I _build -summary-only -text summary
(cd _build; bisect-report ../bisect*.out -html ../report-html)
if [ -n "$TRAVIS" ]; then
echo "\$TRAVIS set; running ocveralls and sending to coveralls.io..."
ocveralls --prefix _build bisect*.out --send
else
echo "\$TRAVIS not set; displaying results of bisect-report..."
cat report
cat summary
fi