run-tests.sh 805 Bytes
Newer Older
Daniel Barlow's avatar
Daniel Barlow committed
1 2
#!/bin/sh

3 4
sok=1

5
do_tests() {
6 7
rm *.$2 || true
( cd .. && echo '(compile-file "asdf")' |$1  )
Daniel Barlow's avatar
Daniel Barlow committed
8 9
for i in *.script; 
do 
10 11 12
  rm *.$2 || true
  if $1 < $i ;then
    echo "Using $1, $i passed" >&2
Daniel Barlow's avatar
Daniel Barlow committed
13
  else
14
    echo "Using $1, $i failed" >&2
15
    sok=0
Daniel Barlow's avatar
Daniel Barlow committed
16 17 18
    exit 1
  fi
done
19
echo "Using $1, all tests apparently successful ($sok)" >&2
20 21 22 23 24 25 26 27 28 29 30
}

# 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 
Daniel Barlow's avatar
Daniel Barlow committed
31
  do_tests "sbcl --userinit /dev/null --sysinit /dev/null --noprogrammer" fasl 
32 33
fi

34
if [ -x /usr/bin/lisp ]
35
then 
Daniel Barlow's avatar
Daniel Barlow committed
36
  do_tests "/usr/bin/lisp -batch -noinit" x86f
37 38 39 40
fi

if [ -x /usr/bin/clisp ]
then 
41
  do_tests "/usr/bin/clisp -norc -ansi -I - " fas
42
fi