-
Notifications
You must be signed in to change notification settings - Fork 10
/
check.sh
executable file
·50 lines (47 loc) · 969 Bytes
/
check.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
#!/bin/bash
set -e
ARGS=("$@")
ALLBINS=(ling ling-fmt)
export PATH=$PWD/tools:$PATH
one(){
local title="$1"
shift
echo "== $title =="
if cmdcheck "${ARGS[@]}" "$@"; then
:
else
echo "Failed at $title, test suite aborted."
exit 1
fi
}
all(){
for d in tests/* issues/*; do
if [ "$d" != issues/keep.t ]; then
if [ -z "$(ls "$d"/*-title)" ]; then
echo "Missing DD-title file for directory $d"
exit 1
fi
fi
done
for t in $(ls -d1 tests/*/*-title issues/*/*-title | sort -t / -k 3); do
one "$(cat "$t")" "$(dirname "$t")"/*.t
done
}
if ling --no-check --no-prims </dev/null >/dev/null; then
:
else
echo "The ling command is not in \$PATH"
exit 1
fi
all
case "$AUTO" in
(1|yes|true)
ALLFULLBINS=()
for b in "${ALLBINS[@]}"; do
ALLFULLBINS=("${ALLFULLBINS}" "$(which "$b")")
done
while : ; do
inotifywait -e delete "${ALLFULLBINS[@]}" || :
all
done;;
esac