-
Notifications
You must be signed in to change notification settings - Fork 36
/
runTestsAndCoverage.sh
executable file
·68 lines (50 loc) · 1.36 KB
/
runTestsAndCoverage.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/sh
set -e
NEWSTYLE=$(([ -d ./dist-newstyle ] && echo "1") || echo "0")
DIST=$(if [ 1 == $NEWSTYLE ]; then
echo ./dist-newstyle/build/io-streams*;
else
echo ./dist
fi)
echo HAVE DIST $DIST
echo HAVE NEWSTYLE $NEWSTYLE
TESTSUITE="./${DIST}/build/testsuite/testsuite"
[ -f "${TESTSUITE}" ] || (
echo "No testsuite executable at $TESTSUITE."; exit 1
)
export LC_ALL=C
export LANG=C
rm -f testsuite.tix
$TESTSUITE -j4 -a1000 $*
# cabal test --show-details=always --test-options="-j4 -a1000 $*"
HPCDIR="${DIST}/hpc"
rm -Rf $HPCDIR
mkdir -p $HPCDIR
EXCLUDES='Main
System.IO.Streams.Tests.Attoparsec.ByteString
System.IO.Streams.Tests.Attoparsec.Text
System.IO.Streams.Tests.Builder
System.IO.Streams.Tests.ByteString
System.IO.Streams.Tests.Combinators
System.IO.Streams.Tests.Concurrent
System.IO.Streams.Tests.Common
System.IO.Streams.Tests.Debug
System.IO.Streams.Tests.File
System.IO.Streams.Tests.Handle
System.IO.Streams.Tests.Internal
System.IO.Streams.Tests.List
System.IO.Streams.Tests.Network
System.IO.Streams.Tests.Process
System.IO.Streams.Tests.Text
System.IO.Streams.Tests.Vector
System.IO.Streams.Tests.Zlib
'
EXCL=""
for m in $EXCLUDES; do
EXCL="$EXCL --exclude=$m"
done
hpc markup $EXCL --destdir="$HPCDIR" testsuite >/dev/null 2>&1
rm -f testsuite.tix
cat <<EOF
Test coverage report written to $HPCDIR.
EOF