| 1 |
#! /bin/sh -vx |
| 2 |
# Public domain. |
| 3 |
|
| 4 |
BinDir=${BinDir:-..} |
| 5 |
ExeExt=${ExeExt:-} |
| 6 |
_mpost=$BinDir/mpost$ExeExt |
| 7 |
_pltotf=$BinDir/pltotf$ExeExt |
| 8 |
|
| 9 |
# pre-generated test results in the repository are stored in LF |
| 10 |
# but the output might be written in CRLF on some platform. |
| 11 |
# if 'diff --strip-trailing-cr' is available, exploit it. |
| 12 |
# (useful for tests on win32 binaries run on MSYS shell) |
| 13 |
DIFF="diff" |
| 14 |
$DIFF --strip-trailing-cr $0 $0 \ |
| 15 |
&& DIFF="diff --strip-trailing-cr" || echo |
| 16 |
|
| 17 |
testdir=$abs_srcdir/triptrap |
| 18 |
|
| 19 |
TEXMFCNF=$testdir; export TEXMFCNF |
| 20 |
|
| 21 |
rm -rf mptrapdir |
| 22 |
mkdir mptrapdir |
| 23 |
cd mptrapdir |
| 24 |
|
| 25 |
dvitype_args="-output-level=2 -dpi=72.27 -page-start='*.*.*.*.*.*.*.*.*.*'" |
| 26 |
|
| 27 |
echo ">>> Running MPTRAP test for MetaPost." >&2 |
| 28 |
echo ">>> See $testdir/mptrap.diffs for example of acceptable diffs." >&2 |
| 29 |
|
| 30 |
set -x |
| 31 |
|
| 32 |
$_pltotf $testdir/trapf.pl trapf.tfm |
| 33 |
|
| 34 |
# get same filename in log |
| 35 |
$LN_S $testdir/mtrap.mp . || exit 1 |
| 36 |
|
| 37 |
$_mpost --ini mtrap |
| 38 |
diff $testdir/mtrap.log mtrap.log |
| 39 |
$DIFF $testdir/mtrap.0 mtrap.0 |
| 40 |
$DIFF $testdir/mtrap.1 mtrap.1 |
| 41 |
$DIFF $testdir/writeo writeo |
| 42 |
$DIFF $testdir/writeo.2 writeo.2 |
| 43 |
|
| 44 |
$LN_S $testdir/trap.mp . || exit 1 |
| 45 |
$LN_S $testdir/trap.mpx . || exit 1 |
| 46 |
|
| 47 |
## Why is --jobname required? And why --ini? |
| 48 |
$_mpost --ini --jobname=trap <$testdir/mptrap1.in >mptrapin.fot |
| 49 |
mv trap.log mptrapin.log || exit 1 |
| 50 |
diff $testdir/mptrapin.log mptrapin.log |
| 51 |
|
| 52 |
exit 0 |
| 53 |
|