Add support for multiple return values to the ERRSET macro
[maxima.git] / tests / test.sh.in
blobc7f2081b76be3ecd88e042eca0ce743acb7a2713
1 #!/bin/sh
3 # This is the general driver used by the testsuite to run tests by
4 # "make check" in the tests directory. It gets processed by a
5 # simple-minded sed script to fill in the lisp implementation etc
6 # below and turns into <lispname>-test.sh
8 LOCAL_MAXIMA="!LOCAL_MAXIMA!"
9 OUTPUT_LOG="!OUTPUT_LOG!"
10 OUTPUT_SHARE_LOG="!OUTPUT_SHARE_LOG!"
11 LISP="!LISPNAME!"
13 # Die if a command fails
14 set -e
16 # This command doesn't exit with a helpful status if the lisp survives
17 # but the test fails so we must check by hand that nothing untoward
18 # happened.
20 # Before we run the testsuite we add the interactive tests and feed them
21 # with input over a pipe. ...and we change the input for questions to
22 # the lisp's standard input so it isn't taken from the keyboard even
23 # if the current lisp defaults to that.
24 echo "Running the share testsuite..."
25 $LOCAL_MAXIMA --lisp=$LISP --batch-string='build_info();run_testsuite(share_tests=only);' 2>&1 | tee "$OUTPUT_SHARE_LOG"
26 echo "Running the testsuite for the maxima core..."
27 $LOCAL_MAXIMA --lisp=$LISP --batch-string='build_info();load("testsuite.lisp");testsuite_files:cons("rtest_ask.mac",testsuite_files);run_testsuite();' < 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 rm "$OUTPUT_SHARE_LOG"
35 exit -1
36 fi;
38 grep -q 'No unexpected errors' <"$OUTPUT_SHARE_LOG"
40 # We'll have another copy of the log from the output of this script,
41 # so there's no point in leaving the greppable one lying around.
42 rm "$OUTPUT_LOG"
43 rm "$OUTPUT_SHARE_LOG"