File: t

package info (click to toggle)
mathomatic 16.0.5-5.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,192 kB
  • sloc: ansic: 22,029; makefile: 340; sh: 319; python: 96; awk: 39
file content (27 lines) | stat: -rwxr-xr-x 958 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh
# Alternative shell script to test Mathomatic that doesn't require the make utility.
# Just run this while in the tests directory with "./t"
# to see if Mathomatic runs properly on your system.
# After reading in and executing the Mathomatic scripts in "all.in",
# it does a diff between the output of the test and the expected output.
# If no differences are reported, "All tests passed 100% correctly" is displayed.

# Usage: ./t [ mathomatic_executable_to_test ]

if [ "$1" != "" ]
then
	MATHOMATICPATH="$1"
else
MATHOMATICPATH="../mathomatic"
if [ ! -x "$MATHOMATICPATH" ]
then
	MATHOMATICPATH=mathomatic
fi
fi

echo
echo Testing $MATHOMATICPATH \(`$MATHOMATICPATH -v`\) || exit 1
TESTOUT=`mktemp /tmp/test.XXXXXXXXXX` || exit 1
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
echo "Test failed.  Errors are in $TESTOUT"
exit 1