From 9d4f1b2454b933d448f1195765b343f0ec266158 Mon Sep 17 00:00:00 2001
From: Daniel Barlow <>
Date: Thu, 28 Feb 2002 03:51:35 +0000
Subject: [PATCH] test with both available implementations without having to
 edit this file.  patches for other CL implementations gratefully accepted

---
 test/run-tests.sh | 43 ++++++++++++++++++++++++++-----------------
 1 file changed, 26 insertions(+), 17 deletions(-)

diff --git a/test/run-tests.sh b/test/run-tests.sh
index a99ba536..c7f06d8d 100644
--- a/test/run-tests.sh
+++ b/test/run-tests.sh
@@ -1,25 +1,34 @@
 #!/bin/sh
 
-# This needs to
-# - read lisp forms one at a time from standard input
-# - quit with exit status 0 on getting eof
-# - quit with exit status >0 if an unhandled error occurs
-#LISP="/usr/local/bin/lisp -batch "
-LISP="sbcl --noprogrammer"
-
-# file extension that $LISP uses for compiled files
-FASL=fasl
-#FASL=axpf
-
-rm *.$FASL || true
+function do_tests {
+rm *.$2 || true
+( cd .. && echo '(compile-file "asdf")' |$1  )
 for i in *.script; 
 do 
-  rm *.$FASL || true
-  if $LISP < $i ;then
-    echo "$i passed"
+  rm *.$2 || true
+  if $1 < $i ;then
+    echo "Using $1, $i passed" >&2
   else
-    echo "$i failed"
+    echo "Using $1, $i failed" >&2
     exit 1
   fi
 done
-echo "All tests apparently successful"
+echo "Using $1, all tests apparently successful" >&2
+}
+
+# do_tests {lisp invocation} {fasl extension}
+# - read lisp forms one at a time from standard input
+# - quit with exit status 0 on getting eof
+# - quit with exit status >0 if an unhandled error occurs
+
+set -e
+
+if type sbcl 
+then 
+  do_tests "sbcl --noprogrammer" fasl 
+fi
+
+if [ -x /usr/local/bin/lisp ]
+then 
+  do_tests "/usr/local/bin/lisp -batch" axpf
+fi
-- 
GitLab