Debian Codegraph @

texk/dviout-util/chkdvifont.test

raw
1 #! /bin/sh -vx
2 # $Id$
3 # Copyright 2018-2026 Japanese TeX Development Community <[email protected]>
4 # You may freely use, modify and/or distribute this file.
5
6 BinDir=${BinDir:-.}
7 ExeExt=${ExeExt:-}
8 _chkdvifont=$BinDir/chkdvifont$ExeExt
9
10 testdir=$srcdir/tests
11
12 DIFF="diff"
13 CMP="cmp"
14 # pre-generated test results in the repository are stored in LF
15 # but the output might be written in CRLF on some platform.
16 # if 'diff --strip-trailing-cr' is available, exploit it.
17 # (useful for tests on win32 binaries run on MSYS shell)
18 $DIFF --strip-trailing-cr $0 $0 \
19 && DIFF="diff --strip-trailing-cr" || echo
20
21 TEXMFCNF=$srcdir/../kpathsea
22 export TEXMFCNF
23
24 ## show banner
25 $_chkdvifont
26
27
28 ## DVI mode
29
30 cp $testdir/oldindep.dvi . && \
31 $_chkdvifont -c ./oldindep.dvi > xoldindep.cfn && \
32 $DIFF $testdir/oldindep.cfn xoldindep.cfn && echo || exit 1
33
34
35 ## TFM/JFM mode
36
37 $_chkdvifont -c $testdir/jis.tfm > xjis.cfn && \
38 $DIFF $testdir/jis.cfn xjis.cfn && echo || exit 2
39
40 # eufm10.tfm is "AMSTeX 2.0 or newer", exit code should be 4
41 $_chkdvifont -c $testdir/eufm10.tfm > xeufm10.cfn
42 if [ $? -ne 4 ]; then exit 3; fi
43 sed 's!2.0/2.1!2.0 or newer!' xeufm10.cfn > xeufm10.ed.cfn
44 $DIFF $testdir/eufm10.cfn xeufm10.ed.cfn && echo || exit 3
45
46
47 ## FONT mode
48
49 $_chkdvifont -c $testdir/cmr10.pk > xcmr10.cfn && \
50 $DIFF $testdir/cmr10.cfn xcmr10.cfn && echo || exit 4
51
52 echo M | $_chkdvifont && echo || exit 0
53
54 # the following tests will not pass for old version written by SHIMA.
55 # that version can be distinguished from the new version by
56 # exit code 250 for usage with stdin M. (the above line did it!)
57
58 # check VF format
59 $_chkdvifont -c $testdir/upjisr-h.vf > xupjisr-h.cfn && \
60 $DIFF $testdir/upjisr-h.cfn xupjisr-h.cfn && echo || exit 5
61
62 # detect new JFM format
63 $_chkdvifont -c $testdir/uparse.tfm > xuparse.cfn && \
64 $DIFF $testdir/uparse.cfn xuparse.cfn && echo || exit 6
65 $_chkdvifont -c $testdir/skipjfmp.tfm > xskipjfmp.cfn && \
66 $DIFF $testdir/skipjfmp.cfn xskipjfmp.cfn && echo || exit 7
67 $_chkdvifont -c $testdir/upphirakakuw3-h.tfm > xupp3-h.cfn && \
68 $DIFF $testdir/upphirakakuw3-h.cfn xupp3-h.cfn && echo || exit 8
69 $_chkdvifont -c $testdir/upphirakakuw6-h.tfm > xupp6-h.cfn && \
70 $DIFF $testdir/upphirakakuw6-h.cfn xupp6-h.cfn && echo || exit 9
71
72
73 ## Unicode filename
74 if [ "$COMSPEC" != "" ] || [ "$ExeExt" = ".exe" ]; then
75 echo "*** We guess OS is Windows."
76 MyOS=Windows
77 command_line_encoding=utf8
78 export command_line_encoding
79 else
80 echo "*** We guess OS is not Windows."
81 MyOS=nonWindows
82 fi
83 cp $testdir/oldindep.dvi ./oidΔДदダ打다𝕯🎉.dvi && \
84 sed -e 's/oldindep/oidΔДदダ打다𝕯🎉/' $testdir/oldindep.cfn > oidΔДदダ打다𝕯🎉.cfn &&
85 $_chkdvifont -c ./oidΔДदダ打다𝕯🎉.dvi > xoidΔДदダ打다𝕯🎉.cfn && \
86 $DIFF oidΔДदダ打다𝕯🎉.cfn xoidΔДदダ打다𝕯🎉.cfn && echo || exit 51
87
88 # output STDOUT to terminal
89 $_chkdvifont -c ./oidΔДदダ打다𝕯🎉.dvi
90
91
92 exit 0
93