3 # Run the regression tests in this directory.
5 # This software is part of the SBCL system. See the README file for
8 # While most of SBCL is derived from the CMU CL system, the test
9 # files (like this one) were written from scratch after the fork
12 # This software is in the public domain and is provided with
13 # absolutely no warranty. See the COPYING and CREDITS files for
16 # how we invoke SBCL in the tests
17 export SBCL="${1:-../src/runtime/sbcl --core ../output/sbcl.core --noinform --sysinit /dev/null --userinit /dev/null --noprint --noprogrammer}"
18 echo /running tests on SBCL=\'$SBCL\'
20 # "Ten four" is the closest numerical slang I can find to "OK", so
21 # it's the Unix status value that we expect from a successful test.
22 # (Of course, zero is the usual success value, but we don't want to
23 # use that because SBCL returns that by default, so we might think
24 # we passed a test when in fact some error caused us to exit SBCL
25 # in a weird unexpected way. In contrast, 104 is unlikely to be
26 # returned unless we exit through the intended explicit "test
37 # *.pure.lisp files are ordinary Lisp code with no side effects,
38 # and we can run them all in a single Lisp process.
39 echo //running '*.pure.lisp' tests
40 echo //i.e. *.pure.lisp
43 for f in *.pure.lisp; do
45 echo " (progn (format t \"//running $f test~%\") (load \"$f\"))"
48 echo " (sb-ext:quit :unix-status 104)) ; Return status=success."
51 # *.impure.lisp files are Lisp code with side effects (e.g. doing
52 # DEFSTRUCT or DEFTYPE or DEFVAR, or messing with the read table).
53 # Each one should be LOADed in a separate invocation of Lisp, so
54 # that we don't need to worry about them interfering with each
56 echo //running '*.impure.lisp' tests
57 for f in *.impure.lisp; do
59 echo //running $f test
60 echo "(load \"$f\")" | $SBCL ; tenfour
64 # *.test.sh files are scripts to test stuff, typically stuff which
65 # can't so easily be tested within Lisp itself. A file foo.test.sh
66 # may be associated with other files foo*, e.g. foo.lisp, foo-1.lisp,
68 echo //running '*.test.sh' tests
69 for f in *.test.sh; do
71 echo //running $f test
72 sh $f "$SBCL"; tenfour
76 # *.assertoids files contain ASSERTOID statements to test things
77 # interpreted and at various compilation levels.
78 echo //running '*.assertoids' tests
79 for f in *.assertoids; do
81 echo //running $f test
82 echo "(load \"$f\")" | $SBCL --eval '(load "assertoid.lisp")' ; tenfour
86 # *.pure-cload.lisp files want to be compiled, then loaded. They
87 # can all be done in the same invocation of Lisp.
88 echo //running '*.pure-cload.lisp' tests
89 for f in *.pure-cload.lisp; do
90 # (Actually here we LOAD each one into a separate invocation
91 # of Lisp just because I haven't figured out a concise way
92 # to LOAD them all into the same Lisp.)
94 echo //running $f test
97 (progn (load *) (sb-ext:quit :unix-status 104))
102 # *.impure-cload.lisp files want to be compiled, then loaded. They
103 # can have side effects, so each one should be done in a separate
104 # invocation of Lisp so that they don't interfere.
105 echo //running '*.impure-cload.lisp' tests
106 for f in *.impure-cload.lisp; do
108 echo //running $f test
109 $SBCL <<EOF ; tenfour
111 (progn (load *) (sb-ext:quit :unix-status 104))
116 # (*.before-xc.lisp and *.after-xc.lisp files aren't handled in this
117 # script at all. They're tests intended to run in the cross-compiler,
118 # so that some functionality can be tested even when cold init doesn't
121 echo '//apparent success (reached end of run-tests.sh normally)'