3
# Run the SLIME test suite in batch mode, saving the results to a file.
3
# Run the SLIME test suite inside screen, saving the results to a file.
5
5
# This script's exit status is the number of tests failed. If no tests
6
6
# fail then no output is printed. If at least one test fails then a
12
12
# This code has been placed in the Public Domain. All warranties
16
echo "Usage: $0 <emacs> <lisp> <dribble-file> <results-file>"
16
echo "Usage: $name [-v] [-r] <emacs> <lisp>"
20
emacs=$1; lisp=$2; dribble=$3; results=$4
21
slimedir=$(dirname $0)
22
while getopts vr opt; do
25
r) dump_results=true;;
23
35
# Move the code into a directory in /tmp, so that we can compile it
24
36
# for the current lisp.
38
slimedir=$(dirname $name)
26
39
testdir=/tmp/slime-test.$$
40
results=$testdir/results
41
dribble=$testdir/dribble
42
statusfile=$testdir/status
27
44
test -d $testdir && rm -r $testdir
28
46
trap "rm -r $testdir" EXIT # remove temporary directory on exit
31
49
cp $slimedir/*.el $slimedir/*.lisp ChangeLog $testdir
33
# you can remove "--batch" to get an emacs window for troubleshooting.
34
$emacs --no-site-file --no-init-file \
35
--eval "(setq debug-on-quit t)" \
36
--eval "(setq max-lisp-eval-depth 1000)" \
37
--eval "(setq load-path (cons \"$testdir\" load-path))" \
38
--eval "(require 'slime)" \
39
--eval "(setq inferior-lisp-program \"$lisp\")" \
40
--eval "(slime-batch-test \"${results}\")" \
45
if [ -f "$results" ]; then
46
echo $status "test(s) failed."
52
session=slime-screen.$$
54
screen -S $session -m -D bash -c "$emacs -nw -q -no-site-file --no-site-file \
55
--eval '(setq debug-on-quit t)' \
56
--eval '(setq max-lisp-eval-depth 1000)' \
57
--eval '(setq load-path (cons \"$testdir\" load-path))' \
58
--eval '(require (quote slime))' \
59
--eval '(setq inferior-lisp-program \"$lisp\")' \
60
--eval '(slime-batch-test \"$results\")' > $dribble;\
61
echo \$? > $statusfile" &
65
if [ "$verbose" = true ]; then
68
cat $dribble > /dev/null &
71
trap "screen -S $session -X quit" SIGINT
74
if [ -f "$statusfile" ]; then
75
[ "$dump_results" = true ] && cat $results;
76
echo $(cat $statusfile) "test(s) failed."