[slime-cvs] CVS slime
heller
heller at common-lisp.net
Sat Oct 21 09:27:50 UTC 2006
Update of /project/slime/cvsroot/slime
In directory clnet:/tmp/cvs-serv5423
Modified Files:
test.sh
Log Message:
Run Emacs in Screen.
--- /project/slime/cvsroot/slime/test.sh 2005/08/29 20:02:58 1.7
+++ /project/slime/cvsroot/slime/test.sh 2006/10/21 09:27:50 1.8
@@ -1,6 +1,6 @@
#!/bin/sh
-# Run the SLIME test suite in batch mode, saving the results to a file.
+# Run the SLIME test suite inside screen, saving the results to a file.
# This script's exit status is the number of tests failed. If no tests
# fail then no output is printed. If at least one test fails then a
@@ -12,42 +12,71 @@
# This code has been placed in the Public Domain. All warranties
# are disclaimed.
-if [ $# != 4 ]; then
- echo "Usage: $0 <emacs> <lisp> <dribble-file> <results-file>"
+function usage () {
+ echo "Usage: $name [-v] [-r] <emacs> <lisp>"
exit 1
-fi
+}
+
+name=$0
+
+while getopts vr opt; do
+ case $opt in
+ v) verbose=true;;
+ r) dump_results=true;;
+ *) usage;;
+ esac
+done
-emacs=$1; lisp=$2; dribble=$3; results=$4
-slimedir=$(dirname $0)
+shift $((OPTIND - 1))
+[ $# = 2 ] || usage
+
+emacs=$1; lisp=$2;
# Move the code into a directory in /tmp, so that we can compile it
# for the current lisp.
+slimedir=$(dirname $name)
testdir=/tmp/slime-test.$$
+results=$testdir/results
+dribble=$testdir/dribble
+statusfile=$testdir/status
+
test -d $testdir && rm -r $testdir
+
trap "rm -r $testdir" EXIT # remove temporary directory on exit
mkdir $testdir
cp $slimedir/*.el $slimedir/*.lisp ChangeLog $testdir
+mkfifo $dribble
-# you can remove "--batch" to get an emacs window for troubleshooting.
-$emacs --no-site-file --no-init-file \
- --eval "(setq debug-on-quit t)" \
- --eval "(setq max-lisp-eval-depth 1000)" \
- --eval "(setq load-path (cons \"$testdir\" load-path))" \
- --eval "(require 'slime)" \
- --eval "(setq inferior-lisp-program \"$lisp\")" \
- --eval "(slime-batch-test \"${results}\")" \
- &> $dribble \
+session=slime-screen.$$
-status=$?
+screen -S $session -m -D bash -c "$emacs -nw -q -no-site-file --no-site-file \
+ --eval '(setq debug-on-quit t)' \
+ --eval '(setq max-lisp-eval-depth 1000)' \
+ --eval '(setq load-path (cons \"$testdir\" load-path))' \
+ --eval '(require (quote slime))' \
+ --eval '(setq inferior-lisp-program \"$lisp\")' \
+ --eval '(slime-batch-test \"$results\")' > $dribble;\
+ echo \$? > $statusfile" &
-if [ -f "$results" ]; then
- echo $status "test(s) failed."
+screenpid=$!
+
+if [ "$verbose" = true ]; then
+ cat $dribble &
+else
+ cat $dribble > /dev/null &
+fi;
+
+trap "screen -S $session -X quit" SIGINT
+wait $screenpid
+
+if [ -f "$statusfile" ]; then
+ [ "$dump_results" = true ] && cat $results;
+ echo $(cat $statusfile) "test(s) failed."
else
# Tests crashed
echo crashed
fi
exit $status
-
More information about the slime-cvs
mailing list