summaryrefslogtreecommitdiff
path: root/Build/source/utils/axodraw2/axodraw2-src/axohelp.test
blob: 5ad6aea2857c194114bf028356330643d89541f8 (plain)
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
#!/bin/sh -vx

# Copyright (C) 2018 John Collins (jcc8@psu.edu)
# You may freely use, modify and/or distribute this file.

if test -z "$test_srcdir"; then
  # If not set, then we are not running from `make check'.
  test_srcdir=`echo "$0" | sed -e 's,/[^\\/]*$,,'`  # == dirname $0
  test "$test_srcdir" = "$0" && test_srcdir=.       # in case subst failed
fi

echo Copying source files if necessary
"$test_srcdir" = . || cp "$test_srcdir"/test* . || exit 1

echo Running axohelp on test document ...
./axohelp test \
    || { echo axohelp failed to run correctly ; exit 1; }

echo Checking result file test.ax2 ...
tr -d '\r' < test.ax2 | diff test.ax2-std - \
    || { echo The .ax2 file created by axohelp was incorrect; exit 1; }

echo Success, so I will remove generated file test.ax2
rm test.ax2