Debian Codegraph @

texk/web2c/etexdir/etriptest.test

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