/[slime]/slime/test.sh
ViewVC logotype

Contents of /slime/test.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.11 - (show annotations)
Fri Aug 8 15:01:05 2008 UTC (5 years, 8 months ago) by heller
Branch: MAIN
Changes since 1.10: +1 -0 lines
File MIME type: application/x-sh
*** empty log message ***
1 #!/bin/sh
2
3 # Run the SLIME test suite inside screen, saving the results to a file.
4
5
6 # This script's exit status is the number of tests failed. If no tests
7 # fail then no output is printed. If at least one test fails then a
8 # one-line summary is printed.
9
10 # If something unexpected fails, you might get an exit code like 127
11 # or 255 instead. Sorry.
12
13 # This code has been placed in the Public Domain. All warranties
14 # are disclaimed.
15
16 function usage () {
17 echo "Usage: $name [-v] [-r] <emacs> <lisp>"
18 exit 1
19 }
20
21 name=$0
22
23 while getopts vr opt; do
24 case $opt in
25 v) verbose=true;;
26 r) dump_results=true;;
27 *) usage;;
28 esac
29 done
30
31 shift $((OPTIND - 1))
32 [ $# = 2 ] || usage
33
34 emacs=$1; lisp=$2;
35
36 # Move the code into a directory in /tmp, so that we can compile it
37 # for the current lisp.
38
39 slimedir=$(dirname $name)
40 testdir=/tmp/slime-test.$$
41 results=$testdir/results
42 dribble=$testdir/dribble
43 statusfile=$testdir/status
44
45 test -d $testdir && rm -r $testdir
46
47 trap "rm -r $testdir" EXIT # remove temporary directory on exit
48
49 mkdir $testdir
50 cp -r $slimedir/*.{el,lisp} ChangeLog $slimedir/contrib $testdir
51 mkfifo $dribble
52
53 cmd=($emacs -nw -q -no-site-file --no-site-file
54 --eval "(setq debug-on-quit t)"
55 --eval "(add-to-list 'load-path \"$testdir\")"
56 --eval "(require 'slime)"
57 --eval "(setq inferior-lisp-program \"$lisp\")"
58 --eval "(slime-batch-test \"$results\")")
59
60 if [ "$verbose" = true ]; then
61 "${cmd[@]}"
62 echo $? > $statusfile
63 else
64 session=slime-screen.$$
65 screen -S $session -m -D \
66 bash -c "\"\$@\"; echo \$? > $statusfile" "" "${cmd[@]}" &
67 screenpid=$!
68 trap "screen -S $session -X quit" SIGINT
69 wait $screenpid
70 fi
71
72 if [ -f "$statusfile" ]; then
73 [ "$dump_results" = true ] && cat $results;
74 echo $(cat $statusfile) "test(s) failed."
75 else
76 # Tests crashed
77 echo crashed
78 fi
79
80 exit $status

  ViewVC Help
Powered by ViewVC 1.1.5