1#! /bin/sh
2
3# Copyright (C) 2010-2014 Peter Breitenlohner <tex-live@tug.org>
4# You may freely use, modify and/or distribute this file.
5
6testdir=$abs_srcdir/triptrap
7ptestdir=$abs_srcdir/ptexdir/ptrip
8
9TEXMFCNF=$ptestdir; export TEXMFCNF
10
11rm -rf ptripdir
12mkdir ptripdir
13cd ptripdir
14
15dvitype_args="-output-level=2 -dpi=72.27 -page-start='*.*.*.*.*.*.*.*.*.*'"
16
17echo ">>> Running TRIP test for pTeX." >&2
18echo ">>> See $ptestdir/ptrip.diffs for example of acceptable diffs." >&2
19
20# pTeX outputs direction of boxes.
21P_SED1='s/, yoko direction//;s/yoko direction, //'
22P_SED2='s/yoko(math) direction, //'
23
24is_OK=:
25
26set -x
27
28echo "*** TRIP test for pTeX ***."
29
30../pltotf $testdir/trip.pl trip.tfm || exit 1
31
32../tftopl ./trip.tfm trip.pl || exit 1
33
34diff $testdir/trip.pl trip.pl || is_OK=false
35
36# get same filename in log
37$LN_S $testdir/trip.tex .
38
39rm -f trip.log
40../ptex --progname=pinitex --ini <$testdir/trip1.in >ptripin.fot
41if test ! -s trip.fmt; then
42  echo "*** trip.fmt not created by trip1.in, investigate!" >&2
43  exit 1
44fi
45sed "$P_SED1" trip.log >  ptripin.log || exit 1
46diff $testdir/tripin.log ptripin.log
47
48# May as well test non-ini second time through.
49rm -f trip.log
50../ptex --progname=ptex <$testdir/trip2.in >ptrip.fot
51sed "$P_SED1;$P_SED2" trip.log > ptrip.log
52diff $testdir/trip.fot ptrip.fot
53
54# We use $DIFF instead of `diff' only for those files where there
55# might actually be legitimate numerical differences.
56$DIFF $DIFFFLAGS $testdir/trip.log ptrip.log
57
58eval ../dvitype $dvitype_args trip.dvi >ptrip.typ || exit 1
59$DIFF $DIFFFLAGS $testdir/trip.typ ptrip.typ
60
61$is_OK || {
62  echo ">>> There were some errors." >&2
63  exit 1
64}
65
66