Skip to content
Snippets Groups Projects
Commit c38c94c6 authored by Robert P. Goldman's avatar Robert P. Goldman Committed by Francois-Rene Rideau
Browse files
parent b6a06201
No related branches found
No related tags found
No related merge requests found
...@@ -6,15 +6,29 @@ ...@@ -6,15 +6,29 @@
# - quit with exit status >0 if an unhandled error occurs # - quit with exit status >0 if an unhandled error occurs
export CL_SOURCE_REGISTRY="$PWD" export CL_SOURCE_REGISTRY="$PWD"
export ASDF_DEBUG=
while getopts "duh" OPTION
do
case OPTION in
d)
ASDF_DEBUG = 1
;;
u)
usage
exit 1
;;
h)
usage
exit 1
;;
esac
done
shift $(($OPTIND - 1))
if [ x"$1" = "xhelp" ]; then if [ x"$1" = "xhelp" ]; then
echo "$0 [lisp invocation] [scripts-regex]" usage
echo " - read lisp forms one at a time from matching scripts" exit 1
echo " - quit with exit status 0 on getting eof"
echo " - quit with exit status >0 if an unhandled error occurs"
echo " you need to supply the .script in the second argument"
echo " lisps include sbcl, clisp, allegro and allegromodern"
exit -1
fi fi
if [ -z "$2" ]; then if [ -z "$2" ]; then
...@@ -25,6 +39,18 @@ fi ...@@ -25,6 +39,18 @@ fi
sok=1 sok=1
usage () {
echo "$0 [lisp invocation] [scripts-regex]"
echo " - read lisp forms one at a time from matching scripts"
echo " - quit with exit status 0 on getting eof"
echo " - quit with exit status >0 if an unhandled error occurs"
echo " you need to supply the .script in the second argument"
echo " lisps include sbcl, clisp, allegro and allegromodern"
echo "OPTIONS:"
echo " -d -- debug mode"
echo " -u -h -- show this message."
}
do_tests() { do_tests() {
command=$1 eval=$2 fasl_ext=$3 command=$1 eval=$2 fasl_ext=$3
rm -f *.$fasl_ext ~/.cache/common-lisp/"`pwd`"/*.$fasl_ext || true rm -f *.$fasl_ext ~/.cache/common-lisp/"`pwd`"/*.$fasl_ext || true
......
...@@ -24,13 +24,23 @@ ...@@ -24,13 +24,23 @@
(ccl::quit return) (ccl::quit return)
#+sbcl #+sbcl
(sb-ext:quit :unix-status return) (sb-ext:quit :unix-status return)
(error "Don't know how to quit Lisp; wanting to use exit code ~a" return)) (error "Don't know how to quit Lisp; wanting to use exit code ~a" return))
(defparameter *asdf-test-debug*
(test-getenv "ASDF_DEBUG")
"Global variable initialized from ASDF_DEBUG environment variable.
Controls whether errors are muffled and dumped to the shell.")
(defmacro quit-on-error (&body body) (defmacro quit-on-error (&body body)
`(call-quitting-on-error (lambda () ,@body))) `(call-quitting-on-error (lambda () ,@body)))
(defun call-quitting-on-error (thunk) (defun call-quitting-on-error (thunk)
"Unless the global *asdf-test-debug* is true,
write a message and exit on an error. If
*asdf-test-debug* is true, enter the debugger
as normal."
(handler-case (handler-case
(progn (funcall thunk) (progn (funcall thunk)
(leave-lisp "~&Script succeeded~%" 0)) (leave-lisp "~&Script succeeded~%" 0))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment