-
Notifications
You must be signed in to change notification settings - Fork 0
/
check.sh
executable file
·69 lines (62 loc) · 1.16 KB
/
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/sh
set -e
# runs all the test suites. use the source, luke.
QUIET="--quiet"
die() { # die die die fornicate 666
echo >&2 $@
exit 1
}
REPORT=ext/mung/user/testbench/report.pl
test -x $REPORT || die "report.pl at '$REPORT' doesn't exist, or isn't executable"
prepare_suite() {
case $1 in
user)
tup $QUIET user/test/testsuite >/dev/null
;;
sys)
tup $QUIET sys/test/systest >/dev/null
;;
host)
tup $QUIET user/test/hostsuite >/dev/null
;;
*)
die "unknown suite $1"
;;
esac
}
# option parsing.
while getopts 'vhs:' OPT; do
case $OPT in
h)
echo "would print help here"
exit 0
;;
v)
echo "sneks ./check.sh v0"
exit 0
;;
s)
test -z "$SUITES" || SUITES="$SUITES "
SUITES="${SUITES}$OPTARG"
;;
\?) die "getopts error (!)" ;;
esac
done
shift `expr $OPTIND - 1`
test $# -gt 0 && die "extraneous command line elements: $@"
test -z "$SUITES" && SUITES="sys user" # "host" is super sekrit mode
for suite in $SUITES; do
echo "-- $suite ..."
prepare_suite $suite
case $suite in
host)
TEST_CMDLINE="user/test/hostsuite 2>&1" $REPORT
;;
user)
$REPORT
;;
sys)
SYSTEST=1 $REPORT
;;
esac
done