-
Notifications
You must be signed in to change notification settings - Fork 111
Expand file tree
/
Copy pathrun-tests.sh
More file actions
executable file
·68 lines (59 loc) · 1.37 KB
/
run-tests.sh
File metadata and controls
executable file
·68 lines (59 loc) · 1.37 KB
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
#!/usr/bin/env bash
set -e
BASE="$(dirname "$0")"
cd "$BASE"
JSCL_PATH="dist/jscl-node.js"
RUNJS=${RUNJS:-node}
usage() {
cat <<EOF
Usage: $0 [OPTIONS]
Run JSCL test suite.
Options:
--sbcl Run tests in SBCL
--jscl=<path> Path to JSCL binary (default: dist/jscl-node.js)
--help Show this help message
Environment variables:
RUNJS JavaScript runtime to use (default: node)
EOF
}
while [ $# -gt 0 ]; do
case "$1" in
--sbcl)
MODE=sbcl
shift
;;
--jscl=*)
MODE=jscl
JSCL_PATH="${1#--jscl=}"
shift
;;
--help|-h)
usage
exit 0
;;
*)
echo "Unknown option: $1" >&2
usage >&2
exit 1
;;
esac
done
MODE=${MODE:-jscl}
case "$MODE" in
sbcl)
echo "Running tests in SBCL..."
sbcl --noinform --non-interactive \
--load jscl.lisp \
--load tests.lisp \
--eval '(jscl-tests:run-tests)'
;;
jscl)
echo "Running tests in JSCL ($JSCL_PATH)..."
tmpfile=$(mktemp /tmp/jscl-tests.XXXXXX.lisp)
echo '(load "tests.lisp") (jscl-tests:run-tests)' > "$tmpfile"
$RUNJS "$JSCL_PATH" "$tmpfile"
status=$?
rm -f "$tmpfile"
exit $status
;;
esac