Fix subtle bug in wipe_nonpinned_words()
[sbcl.git] / tests / clocc-ansi.test.sh
blob1e4cba98f1524ca7eafa3738683a4b4725df354e
1 #!/bin/sh
3 # Run clocc's ansi-test suite on SBCL (if you set the appropriate
4 # environment variable so that the test suite, a separate piece of
5 # software, can be found).
7 # This is implemented as a shell script because ansi-test likes to
8 # report its errors on standard output and it's convenient to use the
9 # *nix shell tools to extract them.
11 # clocc = Common Lisp Open Code Collection, available on
12 # <http://clocc.sourceforge.net/>
13 # ansi-test = one of the subdirectories in clocc, containing lotso tests
14 # for ANSI compliance (and the occasional test for CLISP
15 # compatibility too:-)
17 # This software is part of the SBCL system. See the README file for
18 # more information.
20 # While most of SBCL is derived from the CMU CL system, the test
21 # files (like this one) were written from scratch after the fork
22 # from CMU CL.
24 # This software is in the public domain and is provided with
25 # absolutely no warranty. See the COPYING and CREDITS files for
26 # more information.
28 . ./subr.sh
30 # Find clocc ansi-test (or just punt, returning success).
31 set +u
32 if [ "$SBCL_CLOCC_ANSI_TEST" = "" ] ; then
33 echo //punting clocc ansi-test because SBCL_CLOCC_ANSI_TEST is undefined
34 exit $EXIT_TEST_WIN
35 else
36 echo //going on to run clocc ansi-test in $SBCL_CLOCC_ANSI_TEST
37 cd $SBCL_CLOCC_ANSI_TEST
39 set -u
41 # The condition system is for the weak.
42 tmpprefix="${TMPDIR:-/tmp}/sbcl-clocc-ansi-test-$$"
43 rawfilename="$tmpprefix-raw.tmp"
44 bugsfilename="$tmpprefix-bugs.tmp"
46 # Go SBCL go.
47 run_sbcl <<EOF >$rawfilename
48 (in-package :cl-user)
49 ;;; Tell ansi-test about our known bugs.
50 (load "$SBCL_PWD/clocc-ansi-test-known-bugs.lisp")
51 ;;; Actually run ansi-test.
52 (load "tests.lisp")
53 ;;; Return a special status code to show that we reached the end
54 ;;; normally instead of taking a dirt nap.
55 (print "back from ansi-test tests.lisp")
56 (sb-ext:quit :unix-status 52)
57 EOF
58 if [ $? != 52 ]; then
59 echo "failure: SBCL didn't finish running clocc ansi-test."
60 exit 1
63 # Klingon programmers handle errors by recognizing error strings
64 # in standard output.
65 if egrep 'ERROR!!' $rawfilename > $bugsfilename; then
66 # new bugs, better luck next time
67 cat $bugsfilename
68 exit 1
69 else
70 # only known bugs, happy happy joy joy
71 rm $rawfilename $bugsfilename
72 exit 104