Debian Codegraph @

utils/axodraw2/axodraw2-src/axohelp.test

raw
1 #!/bin/sh -vx
2
3 # Copyright (C) 2018 John Collins (jcc8 at psu dot edu)
4 # You may freely use, modify and/or distribute this file.
5 #
6 # This test is a rudimentary test of axohelp in a form suitable for
7 # use in TeXLive builds.
8
9 # Prevent errors from sed if it encounters non-UTF-8 strings in utf-8 locale
10 LC_ALL=C; export LC_ALL; LANGUAGE=C; export LANGUAGE
11
12 if test -z "$test_srcdir"; then
13 # If not set, then we are not running from `make check'.
14 test_srcdir=`echo "$0" | sed -e 's,/[^\\/]*$,,'` # == dirname $0
15 test "$test_srcdir" = "$0" && test_srcdir=. # in case subst failed
16 fi
17 echo ==================\"$test_srcdir\"=====================
18
19 echo Copying source files if necessary
20 test "$test_srcdir" = . \
21 || cp "$test_srcdir"/test.ax1 "$test_srcdir"/test.ax2-std . \
22 || exit 1
23
24 echo Running axohelp on test document ...
25 ./axohelp test \
26 || { echo axohelp failed to run correctly ; exit 1; }
27
28 echo Checking result file test.ax2, after converting line-endings
29 tr -d '\r' < test.ax2 > tmp.ax2
30 tr -d '\r' < test.ax2-std > tmp.ax2-std
31
32 diff tmp.ax2-std tmp.ax2 \
33 || { echo The .ax2 file created by axohelp was incorrect; exit 1; }
34
35 echo Success, so I will remove generated files test.ax2 and temporaries
36 rm test.ax2 tmp.ax2 tmp.ax2-std
37