| 1 |
#! /bin/sh -vx |
| 2 |
# $Id: eptriptest.test 70943 2024-04-14 05:29:13Z takuji $ |
| 3 |
# Copyright 2023 Japanese TeX Development Community <[email protected]> |
| 4 |
# Copyright 2017-2018 Karl Berry <[email protected]> |
| 5 |
# Copyright 2011-2014 Peter Breitenlohner <[email protected]> |
| 6 |
# Copyright 2010 Hironori Kitagawa <[email protected]> |
| 7 |
# You may freely use, modify and/or distribute this file. |
| 8 |
|
| 9 |
W2CDir=${W2CDir:-..} |
| 10 |
ExeExt=${ExeExt:-} |
| 11 |
_euptex=$W2CDir/euptex$ExeExt |
| 12 |
_pltotf=$W2CDir/pltotf$ExeExt |
| 13 |
_tftopl=$W2CDir/tftopl$ExeExt |
| 14 |
_dvitype=$W2CDir/dvitype$ExeExt |
| 15 |
|
| 16 |
LC_ALL=C; export LC_ALL; LANGUAGE=C; export LANGUAGE |
| 17 |
|
| 18 |
testdir=$abs_srcdir/triptrap |
| 19 |
etestdir=$abs_srcdir/etexdir/etrip |
| 20 |
euptestdir=$abs_srcdir/euptexdir/euptrip |
| 21 |
|
| 22 |
TEXMFCNF=$euptestdir; export TEXMFCNF |
| 23 |
|
| 24 |
rm -rf eupptripdir |
| 25 |
mkdir eupptripdir |
| 26 |
cd eupptripdir |
| 27 |
mkdir -p a b |
| 28 |
|
| 29 |
# TeX Live generic |
| 30 |
cat >filter <<-\_EOF |
| 31 |
/^\*\* \&trip trip/d |
| 32 |
/^\*\*entering extended mode/d |
| 33 |
s,^(trip\.tex ##,**(./trip.tex ##, |
| 34 |
s,^## (\./trip\.tex,**(./trip.tex ##, |
| 35 |
s/ (TeX Live 20[^)]*)// |
| 36 |
s/ (Web2C 202[3-9][^)]*)// |
| 37 |
s/(preloaded format=.*tex)/(INITEX)/ |
| 38 |
s/format=trip [^)][^)]*)/format=trip)/ |
| 39 |
s/) [0-9A-Z: ]*$/)/ |
| 40 |
s,^(\./,(, |
| 41 |
s/[1-9][0-9]* strings out of [1-9].*/XX strings out of YYY/ |
| 42 |
s/[1-9][0-9]* string characters out of [1-9].*/XXX string characters out of YYYY/ |
| 43 |
s/sequences out of [1-9].*/sequences out of YYYY/ |
| 44 |
s/[1-9] hyphenation exceptions* out of [1-9].*/X hyphenation exceptions out of YYY/ |
| 45 |
s/[1-9][0-9]* strings of total length [1-9].*/XXXX strings of total length YYYYY/ |
| 46 |
s/9 ops out of [1-9][0-9]*/9 ops out of YYY/ |
| 47 |
s/TeX output ....\...\...:..../TeX output YYYY.MM.DD:hhmm/ |
| 48 |
_EOF |
| 49 |
|
| 50 |
# x86 glue rounding |
| 51 |
cat >>filter <<-\_EOF |
| 52 |
s/ 16341\.999.*fil/ 16342.0fil/ |
| 53 |
s/ 16238\.999.*fil/ 16239.0fil/ |
| 54 |
s/ 16317\.999.*fil/ 16318.0fil/ |
| 55 |
s/ 16330\.999.*fil/ 16331.0fil/ |
| 56 |
s/ 16331\.999.*fil/ 16332.0fil/ |
| 57 |
s/ 16343\.999.*fil/ 16344.0fil/ |
| 58 |
s/ 9737\.587..fil/ 9737.58789fil/ |
| 59 |
s/down4 639342.../down4 639342208/ |
| 60 |
s/y4 2039217../y4 203921760/ |
| 61 |
s/y0 2039217../y0 203921760/ |
| 62 |
_EOF |
| 63 |
|
| 64 |
# epTeX |
| 65 |
cat >>filter <<-\_EOF |
| 66 |
s/This is .*TeX,/This is *TeX,/ |
| 67 |
s/(utf8[^)]*) // |
| 68 |
s/ Version 3\.141592653[^(]*(/ Version 3.141592653* (/ |
| 69 |
s/ before: [1-9][0-9][0-9][0-9]*&[1-9][0-9][0-9][0-9]*; / before: XXX\&YYY; / |
| 70 |
s/ after: [1-9][0-9][0-9][0-9]*&[1-9][0-9][0-9][0-9]*; / after: XXX\&YYY; / |
| 71 |
s/ still untouched: [1-9][0-9][0-9][0-9]*/ still untouched: XXX/ |
| 72 |
_EOF |
| 73 |
cat >filter1 <<-\_EOF |
| 74 |
:l |
| 75 |
N |
| 76 |
$!b l |
| 77 |
s/ inside a group at level 1).*bottom level/ inside a group at level 1)/ |
| 78 |
_EOF |
| 79 |
|
| 80 |
dvitype_args="-output-level=2 -dpi=72.27 -page-start='*.*.*.*.*.*.*.*.*.*'" |
| 81 |
|
| 82 |
echo ">>> Running e-TRIP test for e-upTeX-euc." >&2 |
| 83 |
echo ">>> See $euptestdir/eptrip.diffs for example of acceptable diffs." >&2 |
| 84 |
|
| 85 |
# pTeX outputs direction of boxes. |
| 86 |
P_SED1='s/, yoko direction//;s/yoko direction, //' |
| 87 |
P_SED2='s/yoko(math) direction, //' |
| 88 |
|
| 89 |
is_OK=: |
| 90 |
|
| 91 |
set -x |
| 92 |
|
| 93 |
echo "*** TRIP test for e-pTeX in compatibility mode ***." |
| 94 |
|
| 95 |
$_pltotf $testdir/trip.pl trip.tfm || exit 1 |
| 96 |
|
| 97 |
$_tftopl ./trip.tfm trip.pl || exit 1 |
| 98 |
|
| 99 |
diff $testdir/trip.pl trip.pl || is_OK=false |
| 100 |
|
| 101 |
# get same filename in log |
| 102 |
$LN_S $testdir/trip.tex . |
| 103 |
|
| 104 |
rm -f trip.log |
| 105 |
$_euptex --kanji-internal=euc --progname=epinitex --ini <$testdir/trip1.in >cptripin.fot |
| 106 |
if test ! -s trip.fmt; then |
| 107 |
echo "*** trip.fmt not created by trip1.in, investigate!" >&2 |
| 108 |
exit 1 |
| 109 |
fi |
| 110 |
sed "$P_SED1" trip.log > cptripin.log || exit 1 |
| 111 |
diff $testdir/tripin.log cptripin.log |
| 112 |
|
| 113 |
# May as well test non-ini second time through. |
| 114 |
rm -f trip.log |
| 115 |
$_euptex --kanji-internal=euc --progname=eptex <$testdir/trip2.in >cptrip.fot |
| 116 |
sed "$P_SED1;$P_SED2" trip.log > cptrip.log |
| 117 |
#diff $testdir/trip.fot cptrip.fot |
| 118 |
|
| 119 |
# We use $DIFF instead of `diff' only for those files where there |
| 120 |
# might actually be legitimate numerical differences. |
| 121 |
$DIFF $DIFFFLAGS $testdir/trip.log cptrip.log |
| 122 |
|
| 123 |
mv tripos.tex cptripos.tex |
| 124 |
diff $testdir/tripos.tex cptripos.tex |
| 125 |
|
| 126 |
eval $_dvitype $dvitype_args trip.dvi >cptrip.typ || exit 1 |
| 127 |
#$DIFF $DIFFFLAGS $testdir/trip.typ cptrip.typ |
| 128 |
|
| 129 |
for f in trip.fot trip.typ; do |
| 130 |
sed -f filter $testdir/$f >a/$f |
| 131 |
sed -f filter cp$f >b/$f |
| 132 |
diff a/$f b/$f || is_OK=false |
| 133 |
done |
| 134 |
|
| 135 |
mv trip.fmt ctrip.fmt |
| 136 |
|
| 137 |
# ================================= |
| 138 |
|
| 139 |
echo "*** TRIP test for e-pTeX in extended mode ***." |
| 140 |
|
| 141 |
rm -f trip.log |
| 142 |
$_euptex --kanji-internal=euc --progname=epinitex --ini <$etestdir/etrip1.in >xptripin.fot |
| 143 |
if test ! -s trip.fmt; then |
| 144 |
echo "*** trip.fmt not created by etrip1.in, investigate!" >&2 |
| 145 |
exit 1 |
| 146 |
fi |
| 147 |
sed "$P_SED1" trip.log > xptripin.log || exit 1 |
| 148 |
diff $testdir/tripin.log xptripin.log |
| 149 |
|
| 150 |
# May as well test non-ini second time through. |
| 151 |
rm -f trip.log |
| 152 |
$_euptex --kanji-internal=euc --progname=eptex <$etestdir/trip2.in >xptrip.fot |
| 153 |
sed "$P_SED1;$P_SED2" trip.log > xptrip.log |
| 154 |
#diff $testdir/trip.fot xptrip.fot |
| 155 |
|
| 156 |
# We use $DIFF instead of `diff' only for those files where there |
| 157 |
# might actually be legitimate numerical differences. |
| 158 |
$DIFF $DIFFFLAGS $testdir/trip.log xptrip.log |
| 159 |
|
| 160 |
mv tripos.tex xptripos.tex |
| 161 |
diff $testdir/tripos.tex xptripos.tex |
| 162 |
|
| 163 |
eval $_dvitype $dvitype_args trip.dvi >xptrip.typ || exit 1 |
| 164 |
#$DIFF $DIFFFLAGS $testdir/trip.typ xptrip.typ |
| 165 |
|
| 166 |
for f in trip.fot trip.typ; do |
| 167 |
sed -f filter $testdir/$f >a/x$f |
| 168 |
sed -f filter xp$f | sed -f filter1 >b/x$f |
| 169 |
diff a/x$f b/x$f || is_OK=false |
| 170 |
done |
| 171 |
|
| 172 |
mv trip.fmt xtrip.fmt |
| 173 |
|
| 174 |
# ================================= |
| 175 |
|
| 176 |
echo "*** e-TeX specific part of e-TRIP test for e-pTeX ***." |
| 177 |
|
| 178 |
$_pltotf $etestdir/etrip.pl etrip.tfm || exit 1 |
| 179 |
|
| 180 |
$_tftopl ./etrip.tfm etrip.pl || exit 1 |
| 181 |
|
| 182 |
diff $etestdir/etrip.pl etrip.pl || is_OK=false |
| 183 |
|
| 184 |
# get same filename in log |
| 185 |
$LN_S $euptestdir/eptrip.tex etrip.tex |
| 186 |
|
| 187 |
$_euptex --kanji-internal=euc --progname=epinitex --ini <$etestdir/etrip2.in >eptripin.fot |
| 188 |
if test ! -s etrip.fmt; then |
| 189 |
echo "*** etrip.fmt not created by etrip2.in, investigate!" >&2 |
| 190 |
exit 1 |
| 191 |
fi |
| 192 |
sed "$P_SED1" etrip.log > eptripin.log || exit 1 |
| 193 |
diff $etestdir/etripin.log eptripin.log |
| 194 |
|
| 195 |
# May as well test non-ini second time through. |
| 196 |
$_euptex --kanji-internal=euc --progname=eptex <$etestdir/etrip3.in >eptrip.fot |
| 197 |
sed "$P_SED1;$P_SED2" etrip.log > eptrip.log |
| 198 |
#diff $etestdir/etrip.fot eptrip.fot |
| 199 |
|
| 200 |
# We use $DIFF instead of `diff' only for those files where there |
| 201 |
# might actually be legitimate numerical differences. |
| 202 |
$DIFF $DIFFFLAGS $euptestdir/eptrip.log eptrip.log |
| 203 |
|
| 204 |
mv etrip.out eptrip.out |
| 205 |
diff $etestdir/etrip.out eptrip.out |
| 206 |
|
| 207 |
eval $_dvitype $dvitype_args etrip.dvi >eptrip.typ || exit 1 |
| 208 |
#$DIFF $DIFFFLAGS $etestdir/etrip.typ eptrip.typ |
| 209 |
|
| 210 |
for f in trip.fot trip.typ; do |
| 211 |
sed -f filter $etestdir/e$f >a/e$f |
| 212 |
sed -f filter ep$f >b/e$f |
| 213 |
diff a/e$f b/e$f || is_OK=false |
| 214 |
done |
| 215 |
|
| 216 |
$is_OK || { |
| 217 |
echo ">>> There were some errors." >&2 |
| 218 |
exit 1 |
| 219 |
} |
| 220 |
|