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

Contents of /slime/test.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.15 - (hide annotations)
Sun Aug 17 23:01:19 2008 UTC (5 years, 8 months ago) by heller
Branch: MAIN
Changes since 1.14: +5 -5 lines
File MIME type: application/x-sh
* swank.lisp (install-fd-handler): Bind *emacs-connection* with
with-connection, for case when the signal hander is called out of
the blue.
(swank-debugger-hook): Don't assume that the hook argument is
#'swank-debugger-hook itself.

* test.sh (usage): Use cat rather not echo for here-documents.
1 lgorrie 1.1 #!/bin/sh
2    
3 heller 1.8 # Run the SLIME test suite inside screen, saving the results to a file.
4 lgorrie 1.1
5 heller 1.13
6 lgorrie 1.1 # 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 lgorrie 1.7 # This code has been placed in the Public Domain. All warranties
14     # are disclaimed.
15    
16 heller 1.8 function usage () {
17 heller 1.15 cat <<EOF
18 heller 1.14 Usage: $name [-b] [-s] [-r] <emacs> <lisp>"
19 heller 1.15 -b disable batch mode
20     -s use screen to hide emacs
21     -r show results file
22 heller 1.14 EOF
23 lgorrie 1.1 exit 1
24 heller 1.8 }
25    
26     name=$0
27 heller 1.14 batch_mode=-batch
28 heller 1.8
29 heller 1.15 while getopts srb opt; do
30 heller 1.8 case $opt in
31 heller 1.14 s) use_screen=true;;
32 heller 1.8 r) dump_results=true;;
33 heller 1.14 b) batch_mode="";;
34 heller 1.8 *) usage;;
35     esac
36     done
37    
38     shift $((OPTIND - 1))
39     [ $# = 2 ] || usage
40 lgorrie 1.1
41 heller 1.8 emacs=$1; lisp=$2;
42 lgorrie 1.1
43     # Move the code into a directory in /tmp, so that we can compile it
44     # for the current lisp.
45    
46 heller 1.8 slimedir=$(dirname $name)
47 lgorrie 1.1 testdir=/tmp/slime-test.$$
48 heller 1.8 results=$testdir/results
49     dribble=$testdir/dribble
50     statusfile=$testdir/status
51    
52 lgorrie 1.1 test -d $testdir && rm -r $testdir
53 heller 1.8
54 lgorrie 1.1 trap "rm -r $testdir" EXIT # remove temporary directory on exit
55    
56     mkdir $testdir
57 heller 1.9 cp -r $slimedir/*.{el,lisp} ChangeLog $slimedir/contrib $testdir
58 heller 1.8 mkfifo $dribble
59 lgorrie 1.1
60 heller 1.14 cmd=($emacs -nw -q -no-site-file $batch_mode --no-site-file
61 heller 1.10 --eval "(setq debug-on-quit t)"
62     --eval "(add-to-list 'load-path \"$testdir\")"
63     --eval "(require 'slime)"
64     --eval "(setq inferior-lisp-program \"$lisp\")"
65     --eval "(slime-batch-test \"$results\")")
66 heller 1.8
67 heller 1.14 if [ "$use_screen" = "" ]; then
68 heller 1.10 "${cmd[@]}"
69     echo $? > $statusfile
70     else
71     session=slime-screen.$$
72     screen -S $session -m -D \
73     bash -c "\"\$@\"; echo \$? > $statusfile" "" "${cmd[@]}" &
74     screenpid=$!
75     trap "screen -S $session -X quit" SIGINT
76     wait $screenpid
77     fi
78 heller 1.8
79     if [ -f "$statusfile" ]; then
80     [ "$dump_results" = true ] && cat $results;
81     echo $(cat $statusfile) "test(s) failed."
82 lgorrie 1.4 else
83     # Tests crashed
84     echo crashed
85 lgorrie 1.1 fi
86    
87     exit $status

  ViewVC Help
Powered by ViewVC 1.1.5