forked from GaloisInc/lustre
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lustre
executable file
·72 lines (53 loc) · 999 Bytes
/
lustre
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
69
#!/bin/bash
BIN=bin
function setup_external_tools {
if [ ! -f "$BIN/test-runner" ]
then
mkdir -p "$BIN"
cabal v2-install --installdir="$BIN" test-lib
fi
}
function show_usage {
cat <<EOM
Usage: $0 COMMAND COMANND_OPTIONS
Available commands:
build Build project
haddock Generate Haddock documentation
test Run some tests
EOM
}
if [ "$#" == "0" ]
then
show_usage
exit 1
fi
COMMAND=$1
shift
case $COMMAND in
build)
echo Building project
cabal v2-build exe:lustre;;
haddock)
echo Building Haddock documentation
cabal v2-haddock;;
run)
cabal v2-run exe:lustre -- $*;;
test)
echo Running tests
setup_external_tools
if [ "$#" == "0" ]
then TESTS=tests
else TESTS=$*
fi
$BIN/test-runner --ext=.lus \
--exe=./run-one-test \
$TESTS
;;
help)
show_usage
exit 0;;
*)
echo Unrecognized command: $COMMAND
show_usage
exit 1;;
esac