diff options
author | Takuji Tanaka <ttk@t-lab.opal.ne.jp> | 2023-08-20 14:26:56 +0000 |
---|---|---|
committer | Takuji Tanaka <ttk@t-lab.opal.ne.jp> | 2023-08-20 14:26:56 +0000 |
commit | bb71bbacb80842b9b3b2e65484493437222f7f34 (patch) | |
tree | b265db45eb108b13b1ce7c6fa3df0fd8a7d90e19 /Build/source/texk/web2c/eptexdir | |
parent | f5a9767f0c69c3e2d9f6c557b14d65bf2cfea1b1 (diff) |
{,e}{,u}ptex: Make easier to test on Windows
git-svn-id: svn://tug.org/texlive/trunk@67990 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/eptexdir')
-rw-r--r-- | Build/source/texk/web2c/eptexdir/ChangeLog | 5 | ||||
-rwxr-xr-x | Build/source/texk/web2c/eptexdir/eptriptest.test | 33 | ||||
-rwxr-xr-x | Build/source/texk/web2c/eptexdir/epver.test | 12 | ||||
-rwxr-xr-x | Build/source/texk/web2c/eptexdir/pdfprimitive.test | 6 | ||||
-rwxr-xr-x | Build/source/texk/web2c/eptexdir/wcfname.test | 82 |
5 files changed, 103 insertions, 35 deletions
diff --git a/Build/source/texk/web2c/eptexdir/ChangeLog b/Build/source/texk/web2c/eptexdir/ChangeLog index 08807a1ed5e..e38a09e7f34 100644 --- a/Build/source/texk/web2c/eptexdir/ChangeLog +++ b/Build/source/texk/web2c/eptexdir/ChangeLog @@ -1,3 +1,8 @@ +2023-08-20 TANAKA Takuji <ttk@t-lab.opal.ne.jp> + + * {eptriptest,epver,pdfprimitive,wcfname}.test: + Make easier to test on Windows. + 2023-03-29 TANAKA Takuji <ttk@t-lab.opal.ne.jp> * wcfname.test: diff --git a/Build/source/texk/web2c/eptexdir/eptriptest.test b/Build/source/texk/web2c/eptexdir/eptriptest.test index 169ae16c6be..e74ba632932 100755 --- a/Build/source/texk/web2c/eptexdir/eptriptest.test +++ b/Build/source/texk/web2c/eptexdir/eptriptest.test @@ -5,6 +5,13 @@ # Copyright 2010 Hironori Kitagawa <tex-live@tug.org> # You may freely use, modify and/or distribute this file. +BinDir=${BinDir:-..} +ExeExt=${ExeExt:-} +_eptex=$BinDir/eptex$ExeExt +_pltotf=$BinDir/pltotf$ExeExt +_tftopl=$BinDir/tftopl$ExeExt +_dvitype=$BinDir/dvitype$ExeExt + LC_ALL=C; export LC_ALL; LANGUAGE=C; export LANGUAGE testdir=$abs_srcdir/triptrap @@ -32,9 +39,9 @@ set -x echo "*** TRIP test for e-pTeX 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 @@ -42,7 +49,7 @@ diff $testdir/trip.pl trip.pl || is_OK=false $LN_S $testdir/trip.tex . rm -f trip.log -../eptex --progname=epinitex --ini <$testdir/trip1.in >cptripin.fot +$_eptex --progname=epinitex --ini <$testdir/trip1.in >cptripin.fot if test ! -s trip.fmt; then echo "*** trip.fmt not created by trip1.in, investigate!" >&2 exit 1 @@ -52,7 +59,7 @@ diff $testdir/tripin.log cptripin.log # May as well test non-ini second time through. rm -f trip.log -../eptex --progname=eptex <$testdir/trip2.in >cptrip.fot +$_eptex --progname=eptex <$testdir/trip2.in >cptrip.fot sed "$P_SED1;$P_SED2" trip.log > cptrip.log diff $testdir/trip.fot cptrip.fot @@ -63,7 +70,7 @@ $DIFF $DIFFFLAGS $testdir/trip.log cptrip.log mv tripos.tex cptripos.tex diff $testdir/tripos.tex cptripos.tex -eval ../dvitype $dvitype_args trip.dvi >cptrip.typ || exit 1 +eval $_dvitype $dvitype_args trip.dvi >cptrip.typ || exit 1 $DIFF $DIFFFLAGS $testdir/trip.typ cptrip.typ mv trip.fmt ctrip.fmt @@ -73,7 +80,7 @@ mv trip.fmt ctrip.fmt echo "*** TRIP test for e-pTeX in extended mode ***." rm -f trip.log -../eptex --progname=epinitex --ini <$etestdir/etrip1.in >xptripin.fot +$_eptex --progname=epinitex --ini <$etestdir/etrip1.in >xptripin.fot if test ! -s trip.fmt; then echo "*** trip.fmt not created by etrip1.in, investigate!" >&2 exit 1 @@ -83,7 +90,7 @@ diff $testdir/tripin.log xptripin.log # May as well test non-ini second time through. rm -f trip.log -../eptex --progname=eptex <$etestdir/trip2.in >xptrip.fot +$_eptex --progname=eptex <$etestdir/trip2.in >xptrip.fot sed "$P_SED1;$P_SED2" trip.log > xptrip.log diff $testdir/trip.fot xptrip.fot @@ -94,7 +101,7 @@ $DIFF $DIFFFLAGS $testdir/trip.log xptrip.log mv tripos.tex xptripos.tex diff $testdir/tripos.tex xptripos.tex -eval ../dvitype $dvitype_args trip.dvi >xptrip.typ || exit 1 +eval $_dvitype $dvitype_args trip.dvi >xptrip.typ || exit 1 $DIFF $DIFFFLAGS $testdir/trip.typ xptrip.typ mv trip.fmt xtrip.fmt @@ -103,16 +110,16 @@ mv trip.fmt xtrip.fmt echo "*** e-TeX specific part of e-TRIP test for e-pTeX ***." -../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 $eptestdir/eptrip.tex etrip.tex -../eptex --progname=epinitex --ini <$etestdir/etrip2.in >eptripin.fot +$_eptex --progname=epinitex --ini <$etestdir/etrip2.in >eptripin.fot if test ! -s etrip.fmt; then echo "*** etrip.fmt not created by etrip2.in, investigate!" >&2 exit 1 @@ -121,7 +128,7 @@ sed "$P_SED1" etrip.log > eptripin.log || exit 1 diff $etestdir/etripin.log eptripin.log # May as well test non-ini second time through. -../eptex --progname=eptex <$etestdir/etrip3.in >eptrip.fot +$_eptex --progname=eptex <$etestdir/etrip3.in >eptrip.fot sed "$P_SED1;$P_SED2" etrip.log > eptrip.log diff $etestdir/etrip.fot eptrip.fot @@ -132,7 +139,7 @@ $DIFF $DIFFFLAGS $eptestdir/eptrip.log eptrip.log mv etrip.out eptrip.out diff $etestdir/etrip.out eptrip.out -eval ../dvitype $dvitype_args etrip.dvi >eptrip.typ || exit 1 +eval $_dvitype $dvitype_args etrip.dvi >eptrip.typ || exit 1 $DIFF $DIFFFLAGS $etestdir/etrip.typ eptrip.typ $is_OK || { diff --git a/Build/source/texk/web2c/eptexdir/epver.test b/Build/source/texk/web2c/eptexdir/epver.test index d2b8adc1f9e..6f3e42128ad 100755 --- a/Build/source/texk/web2c/eptexdir/epver.test +++ b/Build/source/texk/web2c/eptexdir/epver.test @@ -3,13 +3,17 @@ # Copyright 2019 Hironobu Yamashita <h.y.acetaminophen@gmail.com> # You may freely use, modify and/or distribute this file. +BinDir=${BinDir:-.} +ExeExt=${ExeExt:-} +_eptex=$BinDir/eptex$ExeExt + LC_ALL=C; export LC_ALL; LANGUAGE=C; export LANGUAGE TEXMFCNF=$srcdir/../kpathsea; export TEXMFCNF -TEXINPUTS=$srcdir/ptexdir/tests:.; export TEXINPUTS +TEXINPUTS="$srcdir/ptexdir/tests;."; export TEXINPUTS # check consistency between runtime terminal and log -./eptex -ini -etex -interaction batchmode -jobname epver1-log pver1.tex >epver1-term.log || exit 1 +$_eptex -ini -etex -interaction batchmode -jobname epver1-log pver1.tex >epver1-term.log || exit 1 sed -n 's/^This is \([-A-Za-z]*\), Version [^-]*-\([^ ]*\) \(.*\)/\1 \2/p' \ epver1-term.log >epver1-term_ed.log || exit 1 sed -n 's/^This is \([-A-Za-z]*\), Version [^-]*-\([^ ]*\) \(.*\)/\1 \2/p' \ @@ -17,13 +21,13 @@ sed -n 's/^This is \([-A-Za-z]*\), Version [^-]*-\([^ ]*\) \(.*\)/\1 \2/p' \ diff epver1-term_ed.log epver1-log_ed.log || exit 2 # check consistency between runtime and version output -./eptex -version >epver2-self.log || exit 1 +$_eptex -version >epver2-self.log || exit 1 sed -n '1 s/^\([-A-Za-z]*\) [^-]*-\([^ ]*\) \(.*\)/\1 \2/p' \ epver2-self.log >epver2-self_ed.log || exit 1 diff epver1-term_ed.log epver2-self_ed.log || exit 4 # check consistency between version output and version primitives -./eptex -ini -etex -interaction batchmode -jobname epver2-prim pver2.tex || exit 1 +$_eptex -ini -etex -interaction batchmode -jobname epver2-prim pver2.tex || exit 1 sed -n 's/^Engine \([-A-Za-z]*\) \([^ ]*\) \(.*\)/\1 \2/p' \ epver2-prim.log >epver2-prim_ed.log || exit 1 diff epver2-self_ed.log epver2-prim_ed.log || exit 8 diff --git a/Build/source/texk/web2c/eptexdir/pdfprimitive.test b/Build/source/texk/web2c/eptexdir/pdfprimitive.test index 3a06237ab33..2d23793faea 100755 --- a/Build/source/texk/web2c/eptexdir/pdfprimitive.test +++ b/Build/source/texk/web2c/eptexdir/pdfprimitive.test @@ -4,6 +4,10 @@ # Copyright 2015 Peter Breitenlohner <tex-live@tug.org> # You may freely use, modify and/or distribute this file. +BinDir=${BinDir:-.} +ExeExt=${ExeExt:-} +_eptex=$BinDir/eptex$ExeExt + LC_ALL=C; export LC_ALL; LANGUAGE=C; export LANGUAGE TEXMFCNF=$srcdir/../kpathsea; export TEXMFCNF @@ -15,7 +19,7 @@ FILE=pdfprimitive-eptex rm -f $FILE.* $LN_S $srcdir/eptexdir/tests/pdfprimitive-test.tex $FILE.tex -./eptex -ini -etex $FILE && exit 1 +$_eptex -ini -etex $FILE && exit 1 sed 1d $FILE.log >$FILE.out diff --git a/Build/source/texk/web2c/eptexdir/wcfname.test b/Build/source/texk/web2c/eptexdir/wcfname.test index 7555df69310..ce448d9617e 100755 --- a/Build/source/texk/web2c/eptexdir/wcfname.test +++ b/Build/source/texk/web2c/eptexdir/wcfname.test @@ -3,13 +3,27 @@ # Copyright 2022-2023 Japanese TeX Development Community <issue@texjp.org> # You may freely use, modify and/or distribute this file. -test -d eptests || mkdir -p eptests -rm -f eptests/fn*.log eptests/fn*.txt eptests/fn*.tex fn*.tex +engine=eptex +testdir=eptests -rc=0 +KpsDir=${KpsDir:-../kpathsea} +BinDir=${BinDir:-.} +ExeExt=${ExeExt:-} +_kpsewhich=$KpsDir/kpsewhich$ExeExt +_tex=$BinDir/$engine$ExeExt + +test -d $testdir || mkdir -p $testdir +rm -f $testdir/fn*.log $testdir/fn*.txt $testdir/fn*.tex fn*.tex + +rc=0; err1=; err2=; err3=; err4= TEXMFCNF=$srcdir/../kpathsea; export TEXMFCNF -TEXINPUTS=eptests:.; export TEXINPUTS +TEXINPUTS="$testdir;."; export TEXINPUTS + +$_kpsewhich -var-value=TEXMFCNF +$_kpsewhich -progname=$engine -var-value=TEXINPUTS +$_kpsewhich -progname=$engine -var-value=command_line_encoding +$_kpsewhich -progname=$engine -var-value=guess_input_kanji_encoding for loc in C.UTF-8 C.utf8 en_US.UTF-8 en_US.utf8 ja_JP.UTF-8 ja_JP.utf8; do locale -a | grep "^$loc\$" @@ -29,21 +43,43 @@ if [ $ret != 0 ]; then LC_ALL=$loc; LANGUAGE=$loc; export LC_ALL LANGUAGE fi -perl $srcdir/tests/fn-generate.perl eptests +if [ "$COMSPEC" != "" ] || [ "$ExeExt" = ".exe" ]; then + echo "*** We guess OS is Windows." + MyOS=Windows + try_ienc="sjis" +else + echo "*** We guess OS is not Windows." + MyOS=nonWindows + try_ienc="euc sjis" +fi +if [ "$ExeExt" = ".exe" ]; then + opt_win=-windows +else + opt_win= +fi + +perl -s $srcdir/tests/fn-generate.perl $opt_win $testdir pret=$? if [ $pret != 0 ] && [ $pret != 239 ]; then - exit 128 + exit 77 fi # pTeX internal encoding fenc="utf8" -for ienc in euc sjis; do +for ienc in $try_ienc; do for doc in fn-$fenc fnさざ波-$fenc; do echo '>>> Document:'$doc ' File Encoding:'$fenc ' Internal Encoding:'$ienc - ./eptex -ini -interaction nonstopmode -jobname=$doc-$ienc -kanji=$fenc --kanji-internal=$ienc --shell-escape $doc.tex >eptests/$doc-$ienc-term.log || rc=1 - mv $doc-$ienc.txt $doc-$ienc.log eptests/ - diff eptests/$doc-$ienc.txt $srcdir/tests/fn-$fenc.txt || rc=2 + $_kpsewhich -progname=$engine $doc.tex || rc=10 + $_kpsewhich -progname=$engine fn±×÷§¶-utf8.tex || rc=11 + $_tex -ini -interaction nonstopmode -jobname=$doc-$ienc -kanji=$fenc --kanji-internal=$ienc --shell-escape $doc.tex >$testdir/$doc-$fenc-$ienc-term.log || \ + { rc=1 ; err1=$err1" $fenc:$ienc:$doc" ; } + $_kpsewhich -progname=$engine $doc-tmp.tex || rc=12 + $_kpsewhich -progname=$engine fn±×÷§¶-utf8-tmp.tex || rc=13 + mv $doc-$ienc.txt $doc-$ienc.log $testdir/ + diff $testdir/$doc-$ienc.txt $srcdir/tests/fn-$fenc.txt || \ + { rc=2 ; err2=$err2" $fenc:$ienc:$doc" ; } + rm -f $testdir/fn±×÷§¶-utf8-tmp.tex done done @@ -59,21 +95,33 @@ for fenc in sjis euc; do for doc in fnさざ波-$fenc; do ienc=$fenc - if [ "$COMSPEC" != "" ]; then - echo "*** We guess OS is Windows." - if [ $fenc != euc ]; then ienc="sjis"; fi + if [ $MyOS = Windows ]; then + ienc="sjis" else - echo "*** We guess OS is not Windows." if [ $fenc != sjis ]; then ienc="euc"; fi fi echo '>>> Document:'$doc ' File Encoding:'$fenc ' Internal Encoding:'$ienc - ./eptex -ini -interaction nonstopmode -jobname=$doc-$ienc -kanji=$fenc --kanji-internal=$ienc --shell-escape $doc.tex >eptests/$doc-$fenc-term.log || rc=3 - mv $doc-$ienc.txt $doc-$ienc.log eptests/ - diff eptests/$doc-$ienc.txt $srcdir/tests/fn-$fenc.txt || rc=4 + $_kpsewhich -progname=$engine $doc.tex || rc=20 + $_kpsewhich -progname=$engine fn±×÷§¶-utf8.tex || rc=21 + $_tex -ini -interaction nonstopmode -jobname=$doc-$ienc -kanji=$fenc --kanji-internal=$ienc --shell-escape $doc.tex >$testdir/$doc-$fenc-$ienc-term.log || \ + { rc=3 ; err3=$err3" $fenc:$ienc:$doc" ; } + $_kpsewhich -progname=$engine $doc-tmp.tex || rc=22 + $_kpsewhich -progname=$engine fn±×÷§¶-utf8-tmp.tex || rc=23 + mv $doc-$ienc.txt $doc-$ienc.log $testdir/ + diff $testdir/$doc-$ienc.txt $srcdir/tests/fn-$fenc.txt || \ + { rc=4 ; err4=$err4" $fenc:$ienc:$doc" ; } done done +if [ $rc -gt 0 ]; then + if [ -n "$err1" ]; then echo ERROR1 $err1; fi + if [ -n "$err2" ]; then echo ERROR2 $err2; fi + if [ -n "$err3" ]; then echo ERROR3 $err3; fi + if [ -n "$err4" ]; then echo ERROR4 $err4; fi +else + echo PASS +fi exit $rc |