0.6.7.19: added stop-compiler-crash patch from Martin Atzmueller
[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         exit 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 echo //running '*.pure.lisp' tests
22 echo //i.e. *.pure.lisp
23 (for f in *.pure.lisp; do
24     echo "(progn"
25     if [ -f $f ]; then
26         echo "  (progn (format t \"//running $f test~%\") (load \"$f\"))"
27     fi
28     echo "  (sb-ext:quit :unix-status 104))"
29 done) | $sbcl ; tenfour
30
31 # *.impure.lisp files are Lisp code with side effects (e.g. doing DEFSTRUCT
32 # or DEFTYPE or DEFVAR). Each one needs to be run as a separate
33 # invocation of Lisp.
34 echo //running '*.impure.lisp' tests
35 for f in *.impure.lisp; do
36     if [ -f $f ]; then
37         echo //running $f test
38         echo "(load \"$f\")" | $sbcl ; tenfour
39     fi
40 done
41
42 # *.test.sh files are scripts to test stuff, typically stuff which can't
43 # so easily be tested within Lisp itself. A file foo.test.sh
44 # may be associated with other files foo*, e.g. foo.lisp, foo-1.lisp,
45 # or foo.pl.
46 echo //running '*.test.sh' tests
47 for f in *.test.sh; do
48     if [ -f $f ]; then
49         echo //running $f test
50         sh $f ; tenfour
51     fi
52 done
53
54 # *.assertoids files contain ASSERTOID statements to test things
55 # interpreted and at various compilation levels.
56 echo //running '*.assertoids' tests
57 for f in *.assertoids; do
58     if [ -f $f ]; then
59         echo //running $f test
60         echo "(load \"$f\")" | $sbcl --eval '(load "assertoid.lisp")' ; tenfour
61     fi
62 done