Debian Codegraph @

tests/t

raw
1 #!/bin/sh
2 # Alternative shell script to test Mathomatic that doesn't require the make utility.
3 # Just run this while in the tests directory with "./t"
4 # to see if Mathomatic runs properly on your system.
5 # After reading in and executing the Mathomatic scripts in "all.in",
6 # it does a diff between the output of the test and the expected output.
7 # If no differences are reported, "All tests passed 100% correctly" is displayed.
8
9 # Usage: ./t [ mathomatic_executable_to_test ]
10
11 if [ "$1" != "" ]
12 then
13 MATHOMATICPATH="$1"
14 else
15 MATHOMATICPATH="../mathomatic"
16 if [ ! -x "$MATHOMATICPATH" ]
17 then
18 MATHOMATICPATH=mathomatic
19 fi
20 fi
21
22 echo
23 echo Testing $MATHOMATICPATH \(`$MATHOMATICPATH -v`\) || exit 1
24 TESTOUT=`mktemp /tmp/test.XXXXXXXXXX` || exit 1
25 time -p "$MATHOMATICPATH" -t all 0<&- >$TESTOUT && diff -u --strip-trailing-cr all.out $TESTOUT && echo "All tests passed 100% correctly." && rm $TESTOUT && exit 0
26 echo "Test failed. Errors are in $TESTOUT"
27 exit 1