From a2cfae41598186288f45cc73f1e6957a60f5c592 Mon Sep 17 00:00:00 2001 From: Takuji Tanaka Date: Sun, 17 Sep 2023 09:06:29 +0000 Subject: [PATCH] web2c: Make easier to test on Windows git-svn-id: svn://tug.org/texlive/trunk/Build/source@68304 c570f23f-e606-0410-a88d-b1316a301751 --- texk/web2c/ChangeLog | 5 +++++ texk/web2c/etexdir/ChangeLog | 5 +++++ texk/web2c/etexdir/etriptest.test | 33 +++++++++++++++++------------ texk/web2c/etexdir/wprob.test | 7 +++++- texk/web2c/mftraptest.test | 14 ++++++++---- texk/web2c/mplibdir/ChangeLog | 5 +++++ texk/web2c/mplibdir/mptraptest.test | 16 ++++++++++---- texk/web2c/triptest.test | 17 ++++++++++----- texk/web2c/twill.test | 6 +++++- 9 files changed, 80 insertions(+), 28 deletions(-) diff --git a/texk/web2c/ChangeLog b/texk/web2c/ChangeLog index 3664c9e6bb..f186dae1d1 100644 --- a/texk/web2c/ChangeLog +++ b/texk/web2c/ChangeLog @@ -1,3 +1,8 @@ +2023-09-17 TANAKA Takuji + + * {mftraptest,triptest,twill}.test: + Make easier to test on Windows. + 2023-09-04 Andreas Scherer * tangle.ch: Fix typo as in weave.web. diff --git a/texk/web2c/etexdir/ChangeLog b/texk/web2c/etexdir/ChangeLog index 935a075cf3..b7785ce5f0 100644 --- a/texk/web2c/etexdir/ChangeLog +++ b/texk/web2c/etexdir/ChangeLog @@ -1,3 +1,8 @@ +2023-09-17 TANAKA Takuji + + * {etriptest,wprob}.test: + Make easier to test on Windows. + 2023-03-09 Karl Berry * TL'23 release. diff --git a/texk/web2c/etexdir/etriptest.test b/texk/web2c/etexdir/etriptest.test index 04e196d962..588f38b7e7 100755 --- a/texk/web2c/etexdir/etriptest.test +++ b/texk/web2c/etexdir/etriptest.test @@ -4,6 +4,13 @@ # Copyright 2009-2014 Peter Breitenlohner # You may freely use, modify and/or distribute this file. +W2CDir=${W2CDir:-..} +ExeExt=${ExeExt:-} +_etex=$W2CDir/etex$ExeExt +_pltotf=$W2CDir/pltotf$ExeExt +_tftopl=$W2CDir/tftopl$ExeExt +_dvitype=$W2CDir/dvitype$ExeExt + testdir=$abs_srcdir/triptrap etestdir=$abs_srcdir/etexdir/etrip @@ -24,16 +31,16 @@ set -x echo "*** TRIP test for e-TeX in compatibility mode ***." -../pltotf $testdir/trip.pl trip.tfm || exit 1 +$_pltotf $testdir/trip.pl trip.tfm || exit 1 -../tftopl ./trip.tfm trip.pl || exit 1 +$_tftopl ./trip.tfm trip.pl || exit 1 diff $testdir/trip.pl trip.pl || is_OK=false # get same filename in log $LN_S $testdir/trip.tex . -../etex --progname=einitex --ini <$testdir/trip1.in >ctripin.fot +$_etex --progname=einitex --ini <$testdir/trip1.in >ctripin.fot if test ! -s trip.fmt; then echo "*** trip.fmt not created by trip1.in, investigate!" >&2 exit 1 @@ -42,7 +49,7 @@ mv trip.log ctripin.log || exit 1 diff $testdir/tripin.log ctripin.log # May as well test non-ini second time through. -../etex --progname=etex <$testdir/trip2.in >ctrip.fot +$_etex --progname=etex <$testdir/trip2.in >ctrip.fot mv trip.log ctrip.log diff $testdir/trip.fot ctrip.fot @@ -53,7 +60,7 @@ $DIFF $DIFFFLAGS $testdir/trip.log ctrip.log mv tripos.tex ctripos.tex diff $testdir/tripos.tex ctripos.tex -eval ../dvitype $dvitype_args trip.dvi >ctrip.typ || exit 1 +eval $_dvitype $dvitype_args trip.dvi >ctrip.typ || exit 1 $DIFF $DIFFFLAGS $testdir/trip.typ ctrip.typ mv trip.fmt ctrip.fmt @@ -62,7 +69,7 @@ mv trip.fmt ctrip.fmt echo "*** TRIP test for e-TeX in extended mode ***." -../etex --progname=einitex --ini <$etestdir/etrip1.in >xtripin.fot +$_etex --progname=einitex --ini <$etestdir/etrip1.in >xtripin.fot if test ! -s trip.fmt; then echo "*** trip.fmt not created by etrip1.in, investigate!" >&2 exit 1 @@ -71,7 +78,7 @@ mv trip.log xtripin.log || exit 1 diff ctripin.log xtripin.log # May as well test non-ini second time through. -../etex --progname=etex <$etestdir/trip2.in >xtrip.fot +$_etex --progname=etex <$etestdir/trip2.in >xtrip.fot mv trip.log xtrip.log diff ctrip.fot xtrip.fot @@ -82,7 +89,7 @@ $DIFF $DIFFFLAGS ctrip.log xtrip.log mv tripos.tex xtripos.tex diff $testdir/tripos.tex xtripos.tex -eval ../dvitype $dvitype_args trip.dvi >xtrip.typ || exit 1 +eval $_dvitype $dvitype_args trip.dvi >xtrip.typ || exit 1 $DIFF $DIFFFLAGS ctrip.typ xtrip.typ mv trip.fmt xtrip.fmt @@ -91,16 +98,16 @@ mv trip.fmt xtrip.fmt echo "*** e-TeX specific part of e-TRIP test ***." -../pltotf $etestdir/etrip.pl etrip.tfm || exit 1 +$_pltotf $etestdir/etrip.pl etrip.tfm || exit 1 -../tftopl ./etrip.tfm etrip.pl || exit 1 +$_tftopl ./etrip.tfm etrip.pl || exit 1 diff $etestdir/etrip.pl etrip.pl || is_OK=false # get same filename in log $LN_S $etestdir/etrip.tex . -../etex --progname=einitex --ini <$etestdir/etrip2.in >etripin.fot +$_etex --progname=einitex --ini <$etestdir/etrip2.in >etripin.fot if test ! -s etrip.fmt; then echo "*** etrip.fmt not created by etrip2.in, investigate!" >&2 exit 1 @@ -109,7 +116,7 @@ mv etrip.log etripin.log || exit 1 diff $etestdir/etripin.log etripin.log # May as well test non-ini second time through. -../etex --progname=etex <$etestdir/etrip3.in >etrip.fot +$_etex --progname=etex <$etestdir/etrip3.in >etrip.fot diff $etestdir/etrip.fot etrip.fot # We use $DIFF instead of `diff' only for those files where there @@ -118,7 +125,7 @@ $DIFF $DIFFFLAGS $etestdir/etrip.log etrip.log diff $etestdir/etrip.out etrip.out -eval ../dvitype $dvitype_args etrip.dvi >etrip.typ || exit 1 +eval $_dvitype $dvitype_args etrip.dvi >etrip.typ || exit 1 $DIFF $DIFFFLAGS $etestdir/etrip.typ etrip.typ $is_OK || { diff --git a/texk/web2c/etexdir/wprob.test b/texk/web2c/etexdir/wprob.test index 043a28e576..a42390ebe2 100755 --- a/texk/web2c/etexdir/wprob.test +++ b/texk/web2c/etexdir/wprob.test @@ -4,12 +4,17 @@ # Copyright 2011-2013 Peter Breitenlohner # You may freely use, modify and/or distribute this file. +BinDir=${BinDir:-.} +ExeExt=${ExeExt:-} +_etex=$BinDir/etex$ExeExt + rm -rf ewprob.* cp $srcdir/tests/wprob.tex ./ewprob.tex TEXMFCNF=$srcdir/../kpathsea \ - ./etex --ini --etex --file-line-error --interaction=nonstopmode ewprob.tex + $_etex --ini --etex --file-line-error --interaction=nonstopmode ewprob.tex grep '^\./ewprob\.tex:12: Could not open file NoSuchFile\.eps\.$' \ ewprob.log || exit 1 +exit 0 diff --git a/texk/web2c/mftraptest.test b/texk/web2c/mftraptest.test index 61b79a777a..5390e9f688 100755 --- a/texk/web2c/mftraptest.test +++ b/texk/web2c/mftraptest.test @@ -4,6 +4,12 @@ # Copyright 2009-2014 Peter Breitenlohner # You may freely use, modify and/or distribute this file. +W2CDir=${W2CDir:-..} +ExeExt=${ExeExt:-} +_mf=$W2CDir/mf$ExeExt +_tftopl=$W2CDir/tftopl$ExeExt +_gftype=$W2CDir/gftype$ExeExt + # pre-generated test results in the repository are stored in LF # but the output might be written in CRLF on some platform. # if 'diff --strip-trailing-cr' is available, exploit it. @@ -62,7 +68,7 @@ rm -f trap.mf $LN_S $testdir/trap.mf . || exit 1 rm -f trap.base -../mf --progname=inimf <$testdir/mftrap1.in >mftrapin.fot +$_mf --progname=inimf <$testdir/mftrap1.in >mftrapin.fot if test ! -s trap.base; then echo "*** trap.base not created by mftrap1.in, investigate!" >&2 exit 1 @@ -70,16 +76,16 @@ fi mv trap.log mftrapin.log || exit 1 diff $testdir/mftrapin.log mftrapin.log -../mf --progname=inimf <$testdir/mftrap2.in >mftrap.fot +$_mf --progname=inimf <$testdir/mftrap2.in >mftrap.fot mv trap.log mftrap.log || exit 1 mv trap.tfm mftrap.tfm || exit 1 diff $testdir/mftrap.fot mftrap.fot diff $testdir/mftrap.log mftrap.log -../tftopl ./mftrap.tfm mftrap.pl || exit 1 +$_tftopl ./mftrap.tfm mftrap.pl || exit 1 diff $testdir/mftrap.pl mftrap.pl || is_OK=false -../gftype -m -i ./trap.72270gf >trap.typ || exit 1 +$_gftype -m -i ./trap.72270gf >trap.typ || exit 1 $DIFF $testdir/trap.typ trap.typ for f in mftrapin.log mftrap.fot mftrap.log trap.typ; do diff --git a/texk/web2c/mplibdir/ChangeLog b/texk/web2c/mplibdir/ChangeLog index 5829ed62d1..26e8f2fc59 100644 --- a/texk/web2c/mplibdir/ChangeLog +++ b/texk/web2c/mplibdir/ChangeLog @@ -1,3 +1,8 @@ +2023-09-17 TANAKA Takuji + + * mptraptest.test: + Make easier to test on Windows. + 2023-09-16 TANAKA Takuji * mp.w: Fixed a buffer overflow. diff --git a/texk/web2c/mplibdir/mptraptest.test b/texk/web2c/mplibdir/mptraptest.test index f1f610dce0..95a55c8208 100755 --- a/texk/web2c/mplibdir/mptraptest.test +++ b/texk/web2c/mplibdir/mptraptest.test @@ -6,6 +6,14 @@ ExeExt=${ExeExt:-} _mpost=$BinDir/mpost$ExeExt _pltotf=$BinDir/pltotf$ExeExt +# pre-generated test results in the repository are stored in LF +# but the output might be written in CRLF on some platform. +# if 'diff --strip-trailing-cr' is available, exploit it. +# (useful for tests on win32 binaries run on MSYS shell) +DIFF="diff" +$DIFF --strip-trailing-cr $0 $0 \ + && DIFF="diff --strip-trailing-cr" || echo + testdir=$abs_srcdir/triptrap TEXMFCNF=$testdir; export TEXMFCNF @@ -28,10 +36,10 @@ $LN_S $testdir/mtrap.mp . || exit 1 $_mpost --ini mtrap diff $testdir/mtrap.log mtrap.log -diff $testdir/mtrap.0 mtrap.0 -diff $testdir/mtrap.1 mtrap.1 -diff $testdir/writeo writeo -diff $testdir/writeo.2 writeo.2 +$DIFF $testdir/mtrap.0 mtrap.0 +$DIFF $testdir/mtrap.1 mtrap.1 +$DIFF $testdir/writeo writeo +$DIFF $testdir/writeo.2 writeo.2 $LN_S $testdir/trap.mp . || exit 1 $LN_S $testdir/trap.mpx . || exit 1 diff --git a/texk/web2c/triptest.test b/texk/web2c/triptest.test index fda2c50e3d..b49dd54ec4 100755 --- a/texk/web2c/triptest.test +++ b/texk/web2c/triptest.test @@ -4,6 +4,13 @@ # Copyright 2009-2014 Peter Breitenlohner # You may freely use, modify and/or distribute this file. +W2CDir=${W2CDir:-..} +ExeExt=${ExeExt:-} +_tex=$W2CDir/tex$ExeExt +_pltotf=$W2CDir/pltotf$ExeExt +_tftopl=$W2CDir/tftopl$ExeExt +_dvitype=$W2CDir/dvitype$ExeExt + LC_ALL=C; export LC_ALL; LANGUAGE=C; export LANGUAGE testdir=$abs_srcdir/triptrap @@ -58,9 +65,9 @@ is_OK=: set -x -../pltotf $testdir/trip.pl trip.tfm || exit 1 +$_pltotf $testdir/trip.pl trip.tfm || exit 1 -../tftopl ./trip.tfm trip.pl || exit 1 +$_tftopl ./trip.tfm trip.pl || exit 1 diff $testdir/trip.pl trip.pl || is_OK=false @@ -69,7 +76,7 @@ rm -f trip.tex $LN_S $testdir/trip.tex . || exit 1 rm -f trip.fmt -../tex --progname=initex --ini <$testdir/trip1.in >tripin.fot +$_tex --progname=initex --ini <$testdir/trip1.in >tripin.fot if test ! -s trip.fmt; then echo "*** trip.fmt not created by trip1.in, investigate!" >&2 exit 1 @@ -78,7 +85,7 @@ mv trip.log tripin.log || exit 1 diff $testdir/tripin.log tripin.log # May as well test non-ini second time through. -../tex --progname=tex <$testdir/trip2.in >trip.fot +$_tex --progname=tex <$testdir/trip2.in >trip.fot diff $testdir/trip.fot trip.fot # We use $DIFF instead of `diff' only for those files where there @@ -87,7 +94,7 @@ $DIFF $DIFFFLAGS $testdir/trip.log trip.log diff $testdir/tripos.tex tripos.tex || is_OK=false -eval ../dvitype $dvitype_args trip.dvi >trip.typ || exit 1 +eval $_dvitype $dvitype_args trip.dvi >trip.typ || exit 1 $DIFF $DIFFFLAGS $testdir/trip.typ trip.typ for f in tripin.log trip.fot trip.log trip.typ; do diff --git a/texk/web2c/twill.test b/texk/web2c/twill.test index eeaa3a5673..0db85b4e95 100755 --- a/texk/web2c/twill.test +++ b/texk/web2c/twill.test @@ -5,8 +5,12 @@ # Copyright 2009 Peter Breitenlohner # You may freely use, modify and/or distribute this file. +BinDir=${BinDir:-.} +ExeExt=${ExeExt:-} +_twill=$BinDir/twill$ExeExt + test -d tests || mkdir -p tests TEXMFCNF=$srcdir/../kpathsea WEBINPUTS=$srcdir \ - ./twill pooltype || exit 1 + $_twill pooltype || exit 1