cleanup related to RAW's port of RUN-PROGRAM:
[sbcl.git] / tests / run-tests.sh
1 #!/bin/sh
2
3 # Run the regression tests in this directory.
4
5 # how we invoke SBCL
6 sbcl=${1:-sbcl --noinform --noprint --noprogrammer}
7
8 # "Ten four" is the closest numerical slang I can find to "OK", so
9 # it's the return value we expect from a successful test.
10 tenfour () {
11     if [ $? = 104 ]; then
12         echo ok
13     else
14         echo test failed: $?
15         return 1
16     fi
17 }
18
19 # *.pure.lisp files are ordinary Lisp code with no side effects,
20 # and we can run them all in a single Lisp process.
21 (for f in *.pure.lisp; do echo \"$f\"; done) | $sbcl ; tenfour
22
23 # *.impure.lisp files are Lisp code with side effects (e.g. doing DEFSTRUCT
24 # or DEFTYPE or DEFVAR). Each one needs to be run as a separate
25 # invocation of Lisp.
26 for f in *.impure.lisp; do
27     echo $f | $sbcl ; tenfour
28 done
29
30 # *.test.sh files are scripts to test stuff, typically stuff which can't
31 # so easily be tested within Lisp itself. A file foo.test.sh
32 # may be associated with other files foo*, e.g. foo.lisp, foo-1.lisp,
33 # or foo.pl.
34 for f in *.test.sh; do
35     sh $f ; tenfour
36 done
37
38 # *.assertoids files contain ASSERTOID statements to test things
39 # interpreted and at various compilation levels.
40 for f in *.assertoids; do
41     echo "(load \"$f\")" | $sbcl --eval '(load "assertoid.lisp")' ; tenfour
42 done