-
Notifications
You must be signed in to change notification settings - Fork 165
/
runtests.sh
executable file
·48 lines (41 loc) · 996 Bytes
/
runtests.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
#!/bin/sh
set -e
set -x
set -u
CABAL=cabal-dev
if [ -f "/usr/share/java/JLex.jar" ]
then
CLASSPATH+=":/usr/share/java/JLex.jar"
elif [ -f "/usr/share/java/jlex.jar" ]
then
CLASSPATH+=":/usr/share/java/jlex.jar"
elif [ -f "/usr/share/java/jflex.jar" ]
then
CLASSPATH+=":/usr/share/java/jflex.jar"
else
echo "Can't find the JLex library, aborting"
exit 1
fi
if [ -f "/usr/share/java/cup.jar" ]
then
CLASSPATH+=":/usr/share/java/cup.jar"
elif [ -f "/usr/share/java/java_cup.jar" ]
then
CLASSPATH+=":/usr/share/java/java_cup.jar"
else
echo "Can't find the Cup library, aborting"
exit 1
fi
echo "Exporting the new classpath: $CLASSPATH"
export CLASSPATH
# This is a bit useless, but since $@ is an array, it gives strange results to
# put it directly in the command.
flags="$@"
${CABAL} install --only-dependencies --enable-tests
if [ -z "$flags" ]; then
${CABAL} configure --enable-tests
else
${CABAL} configure --enable-tests -f "$flags"
fi
${CABAL} build
${CABAL} test