| 1 |
#! /bin/sh -vx |
| 2 |
# $Id: triptest.test 70943 2024-04-14 05:29:13Z takuji $ |
| 3 |
# Copyright 2017-2021 Karl Berry <[email protected]> |
| 4 |
# Copyright 2009-2014 Peter Breitenlohner <[email protected]> |
| 5 |
# You may freely use, modify and/or distribute this file. |
| 6 |
|
| 7 |
W2CDir=${W2CDir:-..} |
| 8 |
ExeExt=${ExeExt:-} |
| 9 |
_tex=$W2CDir/tex$ExeExt |
| 10 |
_pltotf=$W2CDir/pltotf$ExeExt |
| 11 |
_tftopl=$W2CDir/tftopl$ExeExt |
| 12 |
_dvitype=$W2CDir/dvitype$ExeExt |
| 13 |
|
| 14 |
LC_ALL=C; export LC_ALL; LANGUAGE=C; export LANGUAGE |
| 15 |
|
| 16 |
testdir=$abs_srcdir/triptrap |
| 17 |
TEXMFCNF=$testdir; export TEXMFCNF |
| 18 |
|
| 19 |
rm -rf tripdir |
| 20 |
mkdir tripdir |
| 21 |
cd tripdir |
| 22 |
mkdir a b |
| 23 |
|
| 24 |
# See triptrap/README for explanation of why we believe these diffs are ok. |
| 25 |
|
| 26 |
# TeX Live generic |
| 27 |
cat >filter <<-\_EOF |
| 28 |
s,^\*\*(\./trip\.tex ##,** \&trip trip \ |
| 29 |
(trip.tex ##, |
| 30 |
s/ (TeX Live 20[^)]*)// |
| 31 |
s/ (Web2C 202[3-9][^)]*)// |
| 32 |
s/(preloaded format=tex)/(INITEX)/ |
| 33 |
s/format=trip [^)][^)]*)/format=trip)/ |
| 34 |
s/) [0-9A-Z: ]*$/)/ |
| 35 |
s,^(\./,(, |
| 36 |
s/[1-9][0-9]* strings out of [1-9].*/XX strings out of YYY/ |
| 37 |
s/[1-9][0-9]* string characters out of [1-9].*/XXX string characters out of YYYY/ |
| 38 |
s/sequences out of [1-9].*/sequences out of YYYY/ |
| 39 |
s/[1-9] hyphenation exceptions* out of [1-9].*/X hyphenation exceptions out of YYY/ |
| 40 |
s/[1-9][0-9]* strings of total length [1-9].*/XXXX strings of total length YYYYY/ |
| 41 |
s/9 ops out of [1-9][0-9]*/9 ops out of YYY/ |
| 42 |
s/TeX output ....\...\...:..../TeX output YYYY.MM.DD:hhmm/ |
| 43 |
_EOF |
| 44 |
|
| 45 |
# x86 glue rounding |
| 46 |
cat >>filter <<-\_EOF |
| 47 |
s/ 16341\.999.*fil/ 16342.0fil/ |
| 48 |
s/ 16238\.999.*fil/ 16239.0fil/ |
| 49 |
s/ 16317\.999.*fil/ 16318.0fil/ |
| 50 |
s/ 16330\.999.*fil/ 16331.0fil/ |
| 51 |
s/ 16331\.999.*fil/ 16332.0fil/ |
| 52 |
s/ 16343\.999.*fil/ 16344.0fil/ |
| 53 |
s/ 9737\.587..fil/ 9737.58789fil/ |
| 54 |
s/down4 639342.../down4 639342208/ |
| 55 |
s/y4 2039217../y4 203921760/ |
| 56 |
s/y0 2039217../y0 203921760/ |
| 57 |
_EOF |
| 58 |
|
| 59 |
dvitype_args="-output-level=2 -dpi=72.27 -page-start='*.*.*.*.*.*.*.*.*.*'" |
| 60 |
|
| 61 |
echo ">>> Running TRIP test for TeX." >&2 |
| 62 |
echo ">>> See $testdir/trip.diffs for example of acceptable diffs." >&2 |
| 63 |
|
| 64 |
is_OK=: |
| 65 |
|
| 66 |
set -x |
| 67 |
|
| 68 |
$_pltotf $testdir/trip.pl trip.tfm || exit 1 |
| 69 |
|
| 70 |
$_tftopl ./trip.tfm trip.pl || exit 1 |
| 71 |
|
| 72 |
diff $testdir/trip.pl trip.pl || is_OK=false |
| 73 |
|
| 74 |
# get same filename in log |
| 75 |
rm -f trip.tex |
| 76 |
$LN_S $testdir/trip.tex . || exit 1 |
| 77 |
|
| 78 |
rm -f trip.fmt |
| 79 |
$_tex --progname=initex --ini <$testdir/trip1.in >tripin.fot |
| 80 |
if test ! -s trip.fmt; then |
| 81 |
echo "*** trip.fmt not created by trip1.in, investigate!" >&2 |
| 82 |
exit 1 |
| 83 |
fi |
| 84 |
mv trip.log tripin.log || exit 1 |
| 85 |
diff $testdir/tripin.log tripin.log |
| 86 |
|
| 87 |
# May as well test non-ini second time through. |
| 88 |
$_tex --progname=tex <$testdir/trip2.in >trip.fot |
| 89 |
diff $testdir/trip.fot trip.fot |
| 90 |
|
| 91 |
# We use $DIFF instead of `diff' only for those files where there |
| 92 |
# might actually be legitimate numerical differences. |
| 93 |
$DIFF $DIFFFLAGS $testdir/trip.log trip.log |
| 94 |
|
| 95 |
diff $testdir/tripos.tex tripos.tex || is_OK=false |
| 96 |
|
| 97 |
eval $_dvitype $dvitype_args trip.dvi >trip.typ || exit 1 |
| 98 |
$DIFF $DIFFFLAGS $testdir/trip.typ trip.typ |
| 99 |
|
| 100 |
for f in tripin.log trip.fot trip.log trip.typ; do |
| 101 |
sed -f filter $testdir/$f >a/$f |
| 102 |
sed -f filter $f >b/$f |
| 103 |
diff a/$f b/$f || is_OK=false |
| 104 |
done |
| 105 |
|
| 106 |
$is_OK && { |
| 107 |
echo ">>> All differences are acceptable." >&2 |
| 108 |
} || { |
| 109 |
echo "*** Error(s) found in trip test, investigate!" >&2 |
| 110 |
exit 1 |
| 111 |
} |