transl: do not assume a catch's mode based on the last body form
[maxima.git] / tests / test.sh.in
bloba9185537bb6431f8b8bde0d0b1fe9eb798ed288c
1 #!/bin/sh
3 # This script expects one command line argument: The name of the lisp.
6 # This is the general driver used by the testsuite to run tests by
7 # "make check" in the tests directory. It gets processed by a
8 # simple-minded sed script to fill in the lisp implementation etc
9 # below and turns into <lispname>-test.sh
11 LOCAL_MAXIMA=@top_builddir@/maxima-local
12 OUTPUT_LOG="$1.log"
13 LISP=$1
15 # Die if a command fails
16 set -e
18 # This command doesn't exit with a helpful status if the lisp survives
19 # but the test fails so we must check by hand that nothing untoward
20 # happened.
22 # Before we run the testsuite we add the interactive tests and feed them
23 # with input over a pipe. ...and we change the input for questions to
24 # the lisp's standard input so it isn't taken from the keyboard even
25 # if the current lisp defaults to that.
26 echo "Running the testsuite..."
27 $LOCAL_MAXIMA --lisp=$LISP --batch-string='build_info();testsuite_files:append(["rtest_ask.mac"],testsuite_files);run_testsuite(share_tests=true);' < @abs_top_srcdir@/tests/rtest_ask_input.mac 2>&1 | tee "$OUTPUT_LOG"
29 grep -q 'No unexpected errors' <"$OUTPUT_LOG"
30 if test $? -ne 0 ; then
31 # We'll have another copy of the log from the output of this script,
32 # so there's no point in leaving the greppable one lying around.
33 rm "$OUTPUT_LOG"
34 exit 1
35 fi;
38 # We'll have another copy of the log from the output of this script,
39 # so there's no point in leaving the greppable one lying around.
40 rm "$OUTPUT_LOG"