Skip to content

Commit

Permalink
dvips: update tests
Browse files Browse the repository at this point in the history
git-svn-id: svn://tug.org/texlive/trunk/Build/source@67885 c570f23f-e606-0410-a88d-b1316a301751
  • Loading branch information
t-tk committed Aug 11, 2023
1 parent 21a4444 commit 3fb48a4
Show file tree
Hide file tree
Showing 10 changed files with 73 additions and 27 deletions.
6 changes: 6 additions & 0 deletions texk/dvipsk/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2023-08-11 TANAKA Takuji <ttk@t-lab.opal.ne.jp>

* beginfontk1.test, eepic-nan.test, pfbincl.test, same-name.test,
test-{afm2tfm,dvips,missing-image,overflow-buffers}.test,
uptex-vf.test: Make easier to test on Windows.

2023-04-29 TANAKA Takuji <ttk@t-lab.opal.ne.jp>

* {virtualfont,pprescan,scanpage,dopage,tfmload}.c, dvips.h:
Expand Down
6 changes: 5 additions & 1 deletion texk/dvipsk/beginfontk1.test
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
# ensure -K1 does not remove newline after %%BeginFont line.
# Report from T S, 1 Jan 2010 16:32:16.

BinDir=${BinDir:-.}
ExeExt=${ExeExt:-}
_dvips=$BinDir/dvips$ExeExt

tst=beginfontk1
./dvips -K1 $srcdir/testdata/$tst.dvi -o || exit 1
$_dvips -K1 $srcdir/testdata/$tst.dvi -o || exit 1
grep '^%%BeginFont: /MC1_ArialBold$' $tst.ps || exit 1

exit 0
6 changes: 5 additions & 1 deletion texk/dvipsk/eepic-nan.test
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
# ensure we don't get nan from eepic doc.
# Report from Stefan Moser to mactex-support, 20 Oct 2010 02:37:45.

BinDir=${BinDir:-.}
ExeExt=${ExeExt:-}
_dvips=$BinDir/dvips$ExeExt

tst=eepic-nan
./dvips -Ppdf $srcdir/testdata/$tst.dvi -o || exit 1
$_dvips -Ppdf $srcdir/testdata/$tst.dvi -o || exit 1
grep ' nan ' $tst.ps && exit 1

exit 0
6 changes: 5 additions & 1 deletion texk/dvipsk/pfbincl.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
# $Id$
# Public domain.

./dvips -D 300 $srcdir/testdata/pfbincl.xdv -o pfbincl.ps || exit 1
BinDir=${BinDir:-.}
ExeExt=${ExeExt:-}
_dvips=$BinDir/dvips$ExeExt

$_dvips -D 300 $srcdir/testdata/pfbincl.xdv -o pfbincl.ps || exit 1
diff $srcdir/testdata/pfbincl.xps pfbincl.ps

exit 0
Expand Down
6 changes: 5 additions & 1 deletion texk/dvipsk/same-name.test
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@
# Public domain.
# Test oname == iname.

BinDir=${BinDir:-.}
ExeExt=${ExeExt:-}
_dvips=$BinDir/dvips$ExeExt

rm -f same-name.dvi same-name.out

./dvips same-name.dvi -o same-name.dvi 2>same-name.out \
$_dvips same-name.dvi -o same-name.dvi 2>same-name.out \
&& exit 1

grep 'Output name should be different from input name' \
Expand Down
8 changes: 6 additions & 2 deletions texk/dvipsk/test-afm2tfm.test
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
# make -C $wp TESTS=test-afm2tfm.test check
# where wp=.../Work/texk/dvipsk

BinDir=${BinDir:-.}
ExeExt=${ExeExt:-}
_afm2tfm=$BinDir/afm2tfm$ExeExt

test_file=afmtest.afm
test_dir=$srcdir/../tests/texmf
test_input=$test_dir/$test_file
Expand Down Expand Up @@ -34,7 +38,7 @@ do_check () {
# could run tftopl, but let's not assume it.
}

do_check ./afm2tfm "$test_file"
do_check ./afm2tfm "$test_file" -p $srcdir/testdata/8r.enc # options after
do_check $_afm2tfm "$test_file"
do_check $_afm2tfm "$test_file" -p $srcdir/testdata/8r.enc # options after

exit 0
8 changes: 6 additions & 2 deletions texk/dvipsk/test-dvips.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@
# $Id$
# Public domain.

BinDir=${BinDir:-.}
ExeExt=${ExeExt:-}
_dvips=$BinDir/dvips$ExeExt

rm -f mtest.ps

./dvips -D 300 $srcdir/testdata/dvipstst.xdv -o dvipstst.ps
$_dvips -D 300 $srcdir/testdata/dvipstst.xdv -o dvipstst.ps
mv dvipstst.ps mtest.ps || exit 1
./dvips -D 300 $srcdir/testdata/dvipstst.xdv -o || exit 1
$_dvips -D 300 $srcdir/testdata/dvipstst.xdv -o || exit 2
diff $srcdir/testdata/dvipstst.xps dvipstst.ps

exit 0
Expand Down
6 changes: 5 additions & 1 deletion texk/dvipsk/test-missing-image.test
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
# make -C $wp TESTS=test-missing-image.test check
# where wp=.../Work/texk/dvipsk

if ./dvips $srcdir/testdata/missing-image.dvi -o missing-image.ps; then
BinDir=${BinDir:-.}
ExeExt=${ExeExt:-}
_dvips=$BinDir/dvips$ExeExt

if $_dvips $srcdir/testdata/missing-image.dvi -o missing-image.ps; then
echo "$0: found image file, but shouldn't have." >&2
exit 1
fi
Expand Down
8 changes: 6 additions & 2 deletions texk/dvipsk/test-overflow-buffers.test
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
# Public domain. Various buffer overflows, reported by
# Andy Nguyen of ETH Zurich. The program should detect and abort.

BinDir=${BinDir:-.}
ExeExt=${ExeExt:-}
_dvips=$BinDir/dvips$ExeExt

for tst in overflow-color-push overflow-epsfile \
overflow-ifffile overflow-psbox; do
:
if ./dvips $srcdir/testdata/$tst.dvi -o; then
if $_dvips $srcdir/testdata/$tst.dvi -o; then
echo "$0: test $tst should have failed." >&2
exit 1
fi
Expand All @@ -15,7 +19,7 @@ done
# overflow-keyword succeeds, because the special is ignored,
# because the file (named with 999 a's) does not exist.
tst=overflow-keyword
./dvips $srcdir/testdata/$tst.dvi -o || exit 1
$_dvips $srcdir/testdata/$tst.dvi -o || exit 1
grep ' @setspecial' $tst.ps || exit 1

exit 0
40 changes: 24 additions & 16 deletions texk/dvipsk/uptex-vf.test
Original file line number Diff line number Diff line change
Expand Up @@ -3,52 +3,60 @@
# Public domain.
# You may freely use, modify and/or distribute this file.

BinDir=${BinDir:-.}
ExeExt=${ExeExt:-}
_dvips=$BinDir/dvips$ExeExt

TEXFONTS=".;$srcdir/testdata"
SOURCE_DATE_EPOCH=1588474800
export TEXFONTS SOURCE_DATE_EPOCH

rm -f upjf.vf upjv.vf upjf-g.ofm upjv-g.ofm upjf-r.ofm upjv-r.ofm

rc=0

cp $srcdir/testdata/upjf_full.vf ./upjf.vf && \
cp $srcdir/testdata/upjv_full.vf ./upjv.vf && \
./dvips -d 4 $srcdir/testdata/upjf.dvi -o upjf.ps -u $srcdir/testdata/upjf.map && \
mv upjf.ps upjf_full.ps || exit 1
$_dvips -d 4 $srcdir/testdata/upjf.dvi -o upjf.ps -u $srcdir/testdata/upjf.map && \
mv upjf.ps upjf_full.ps || rc=1

cp $srcdir/testdata/upjf_omit.vf ./upjf.vf && \
cp $srcdir/testdata/upjv_omit.vf ./upjv.vf && \
cp $srcdir/testdata/upjf-g00.ofm ./upjf-g.ofm && \
cp $srcdir/testdata/upjv-g00.ofm ./upjv-g.ofm && \
./dvips -d 4 $srcdir/testdata/upjf.dvi -o upjf.ps -u $srcdir/testdata/upjf.map && \
mv upjf.ps upjf_omit.ps || exit 2
$_dvips -d 4 $srcdir/testdata/upjf.dvi -o upjf.ps -u $srcdir/testdata/upjf.map && \
mv upjf.ps upjf_omit.ps || rc=2

diff upjf_full.ps upjf_omit.ps || exit 3
diff upjf_full.ps upjf_omit.ps || rc=3

cp $srcdir/testdata/upjf-r00.ofm ./upjf-r.ofm && \
cp $srcdir/testdata/upjv-r00.ofm ./upjv-r.ofm && \
./dvips -d 4 $srcdir/testdata/upjf.dvi -o upjf.ps -u $srcdir/testdata/upjf.map && \
mv upjf.ps upjf_omit2.ps || exit 4
$_dvips -d 4 $srcdir/testdata/upjf.dvi -o upjf.ps -u $srcdir/testdata/upjf.map && \
mv upjf.ps upjf_omit2.ps || rc=4

diff upjf_full.ps upjf_omit2.ps || exit 5
diff upjf_full.ps upjf_omit2.ps || rc=5


rm -f upjf-r.ofm upjv-r.ofm

cp $srcdir/testdata/upjf1_full.vf ./upjf.vf && \
cp $srcdir/testdata/upjv_full.vf ./upjv.vf && \
./dvips -d 4 $srcdir/testdata/upjf.dvi -o upjf1.ps -u $srcdir/testdata/upjf.map && \
mv upjf1.ps upjf1_full.ps || exit 6
$_dvips -d 4 $srcdir/testdata/upjf.dvi -o upjf1.ps -u $srcdir/testdata/upjf.map && \
mv upjf1.ps upjf1_full.ps || rc=6

cp $srcdir/testdata/upjf1_omit.vf ./upjf.vf && \
cp $srcdir/testdata/upjv_omit.vf ./upjv.vf && \
cp $srcdir/testdata/upjf1-r.tfm ./upjf-r.tfm && \
./dvips -d 4 $srcdir/testdata/upjf.dvi -o upjf1.ps -u $srcdir/testdata/upjf.map && \
mv upjf1.ps upjf1_omit.ps || exit 7
$_dvips -d 4 $srcdir/testdata/upjf.dvi -o upjf1.ps -u $srcdir/testdata/upjf.map && \
mv upjf1.ps upjf1_omit.ps || rc=7

diff upjf1_full.ps upjf1_omit.ps || exit 8
diff upjf1_full.ps upjf1_omit.ps || rc=8

cp $srcdir/testdata/upjf-r00.ofm ./upjf-r.ofm && \
cp $srcdir/testdata/upjv-r00.ofm ./upjv-r.ofm && \
./dvips -d 4 $srcdir/testdata/upjf.dvi -o upjf1.ps -u $srcdir/testdata/upjf.map && \
mv upjf1.ps upjf1_omit2.ps || exit 9
$_dvips -d 4 $srcdir/testdata/upjf.dvi -o upjf1.ps -u $srcdir/testdata/upjf.map && \
mv upjf1.ps upjf1_omit2.ps || rc=9

diff upjf1_full.ps upjf1_omit2.ps || rc=10

diff upjf1_full.ps upjf1_omit2.ps || exit 10
exit $rc

0 comments on commit 3fb48a4

Please sign in to comment.