diff options
author | Takuji Tanaka <ttk@t-lab.opal.ne.jp> | 2023-08-20 14:27:05 +0000 |
---|---|---|
committer | Takuji Tanaka <ttk@t-lab.opal.ne.jp> | 2023-08-20 14:27:05 +0000 |
commit | 93a4e8c6daed9a541c27bcaa86bf18851a8c4f0c (patch) | |
tree | 54ee73731d7151b2908eaa7d0f0bb08ec81c68e7 /Build/source/texk/web2c/pdftexdir | |
parent | bb71bbacb80842b9b3b2e65484493437222f7f34 (diff) |
pdftex: Make easier to test on Windows
git-svn-id: svn://tug.org/texlive/trunk@67991 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/pdftexdir')
-rw-r--r-- | Build/source/texk/web2c/pdftexdir/ChangeLog | 6 | ||||
-rwxr-xr-x | Build/source/texk/web2c/pdftexdir/expanded.test | 8 | ||||
-rwxr-xr-x | Build/source/texk/web2c/pdftexdir/pdfimage.test | 10 | ||||
-rwxr-xr-x | Build/source/texk/web2c/pdftexdir/pdftex.test | 8 | ||||
-rwxr-xr-x | Build/source/texk/web2c/pdftexdir/pdftosrc.test | 22 | ||||
-rwxr-xr-x | Build/source/texk/web2c/pdftexdir/ttf2afm.test | 4 | ||||
-rwxr-xr-x | Build/source/texk/web2c/pdftexdir/wcfname.test | 74 | ||||
-rwxr-xr-x | Build/source/texk/web2c/pdftexdir/wprob.test | 4 |
8 files changed, 111 insertions, 25 deletions
diff --git a/Build/source/texk/web2c/pdftexdir/ChangeLog b/Build/source/texk/web2c/pdftexdir/ChangeLog index 6fe4a4e7f91..446d89a5f20 100644 --- a/Build/source/texk/web2c/pdftexdir/ChangeLog +++ b/Build/source/texk/web2c/pdftexdir/ChangeLog @@ -1,3 +1,9 @@ +2023-08-20 TANAKA Takuji <ttk@t-lab.opal.ne.jp> + + * {expanded,pdfimage,pdftex,pdftosrc,ttf2afm,wcfname, + wprob}.test: + Make easier to test on Windows. + 2023-08-18 Hironobu Yamashita <h.y.acetaminophen@gmail.com> * pdftex.web: minor cleanup (sync with etex.ch r24155) diff --git a/Build/source/texk/web2c/pdftexdir/expanded.test b/Build/source/texk/web2c/pdftexdir/expanded.test index 86e553c2b27..33d6faf3a6e 100755 --- a/Build/source/texk/web2c/pdftexdir/expanded.test +++ b/Build/source/texk/web2c/pdftexdir/expanded.test @@ -4,12 +4,16 @@ # David Carlisle: version for \expanded based on existing test scripts # by Peter Breitenlohner and Karl Berry. +BinDir=${BinDir:-.} +ExeExt=${ExeExt:-} +_pdftex=$BinDir/pdftex$ExeExt + LC_ALL=C; export LC_ALL; LANGUAGE=C; export LANGUAGE TEXMFCNF=$srcdir/../kpathsea; export TEXMFCNF -TEXINPUTS=$srcdir/pdftexdir/tests:.; export TEXINPUTS +TEXINPUTS="$srcdir/pdftexdir/tests;."; export TEXINPUTS -./pdftex -ini -etex --interaction batchmode expanded.tex +$_pdftex -ini -etex --interaction batchmode expanded.tex sed -n -e 's/[\\]pdf/\\/g' -e '/START/,/END/p' expanded.log \ >expanded_pdftex.log || exit 1 diff --git a/Build/source/texk/web2c/pdftexdir/pdfimage.test b/Build/source/texk/web2c/pdftexdir/pdfimage.test index d41d1f6c975..57997ae96ce 100755 --- a/Build/source/texk/web2c/pdftexdir/pdfimage.test +++ b/Build/source/texk/web2c/pdftexdir/pdfimage.test @@ -4,12 +4,16 @@ # Copyright 2013 Peter Breitenlohner <tex-live@tug.org> # You may freely use, modify and/or distribute this file. +BinDir=${BinDir:-.} +ExeExt=${ExeExt:-} +_pdftex=$BinDir/pdftex$ExeExt + TEXMFCNF=$srcdir/../kpathsea; export TEXMFCNF -TEXINPUTS=$srcdir/pdftexdir/tests:$srcdir/tests; export TEXINPUTS +TEXINPUTS="$srcdir/pdftexdir/tests;$srcdir/tests"; export TEXINPUTS TEXFORMATS=.; export TEXFORMATS -./pdftex -ini -interaction=batchmode pdfimage </dev/null || exit 1 +$_pdftex -ini -interaction=batchmode pdfimage </dev/null || exit 1 -./pdftex -fmt=pdfimage -interaction=batchmode pdfimage </dev/null || exit 1 +$_pdftex -fmt=pdfimage -interaction=batchmode pdfimage </dev/null || exit 2 exit 0 diff --git a/Build/source/texk/web2c/pdftexdir/pdftex.test b/Build/source/texk/web2c/pdftexdir/pdftex.test index 0bd27896d0b..107b9f2a881 100755 --- a/Build/source/texk/web2c/pdftexdir/pdftex.test +++ b/Build/source/texk/web2c/pdftexdir/pdftex.test @@ -6,6 +6,10 @@ # Make sure the program executes. -./pdftex --version || exit 1 -./pdftex --help || exit 1 +BinDir=${BinDir:-.} +ExeExt=${ExeExt:-} +_pdftex=$BinDir/pdftex$ExeExt + +$_pdftex --version || exit 1 +$_pdftex --help || exit 1 exit 0 diff --git a/Build/source/texk/web2c/pdftexdir/pdftosrc.test b/Build/source/texk/web2c/pdftexdir/pdftosrc.test index e93c3e83eab..5c7113e2ebb 100755 --- a/Build/source/texk/web2c/pdftexdir/pdftosrc.test +++ b/Build/source/texk/web2c/pdftexdir/pdftosrc.test @@ -4,17 +4,29 @@ # Copyright 2011 Peter Breitenlohner <tex-live@tug.org> # You may freely use, modify and/or distribute this file. +BinDir=${BinDir:-.} +ExeExt=${ExeExt:-} +_pdftosrc=$BinDir/pdftosrc$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 + src=$srcdir/pdftexdir/tests rm -rf test-13.* test-15.* cp $src/test-13.pdf . -./pdftosrc test-13.pdf -1 \ - && diff test-13.xref $src/test-13.xref \ +$_pdftosrc test-13.pdf -1 \ + && $DIFF test-13.xref $src/test-13.xref \ || exit 1 cp $src/test-15.pdf . -./pdftosrc test-15.pdf -1 \ - && diff test-15.xref $src/test-15.xref \ - || exit 1 +$_pdftosrc test-15.pdf -1 \ + && $DIFF test-15.xref $src/test-15.xref \ + || exit 2 diff --git a/Build/source/texk/web2c/pdftexdir/ttf2afm.test b/Build/source/texk/web2c/pdftexdir/ttf2afm.test index 436aa0c1a1d..b4c4e6c59b8 100755 --- a/Build/source/texk/web2c/pdftexdir/ttf2afm.test +++ b/Build/source/texk/web2c/pdftexdir/ttf2afm.test @@ -4,6 +4,10 @@ # Copyright 2013 Peter Breitenlohner <tex-live@tug.org> # You may freely use, modify and/or distribute this file. +BinDir=${BinDir:-.} +ExeExt=${ExeExt:-} +_pdftex=$BinDir/pdftex$ExeExt + LC_ALL=C; export LC_ALL; LANGUAGE=C; export LANGUAGE TEXMFCNF=$srcdir/../kpathsea; export TEXMFCNF diff --git a/Build/source/texk/web2c/pdftexdir/wcfname.test b/Build/source/texk/web2c/pdftexdir/wcfname.test index b5c2a7802a6..529f5aeccc7 100755 --- a/Build/source/texk/web2c/pdftexdir/wcfname.test +++ b/Build/source/texk/web2c/pdftexdir/wcfname.test @@ -3,37 +3,85 @@ # Copyright 2022-2023 Japanese TeX Development Community <issue@texjp.org> # You may freely use, modify and/or distribute this file. -test -d pdftests || mkdir -p pdftests -rm -f pdftests/fn*.log pdftests/fn*.txt pdftests/fn*.tex fn*.tex +engine=pdftex +testdir=pdftests -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= TEXMFCNF=$srcdir/../kpathsea; export TEXMFCNF -TEXINPUTS=pdftests:.; export TEXINPUTS +TEXINPUTS="$testdir;."; export TEXINPUTS -perl $srcdir/tests/fn-generate.perl pdftests -pret=$? -if [ $pret != 0 ] && [ $pret != 239 ]; then - exit 128 +$_kpsewhich -var-value=TEXMFCNF +$_kpsewhich -progname=$engine -var-value=TEXINPUTS +$_kpsewhich -progname=$engine -var-value=command_line_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\$" + ret=$? + # For Slackware linux, we need to replace from utf8 to UTF-8 + if [ -f /etc/slackware-version ]; then + loc=`echo $loc | sed -e "s/utf8/UTF-8/"` + fi + if [ $ret = 0 ]; then + LC_ALL=$loc; LANGUAGE=$loc; export LC_ALL LANGUAGE + break + fi +done +if [ $ret != 0 ]; then + # linux musl fails to run `locale -a` but seems to have C.UTF-8 + loc=C.UTF-8 + LC_ALL=$loc; LANGUAGE=$loc; export LC_ALL LANGUAGE fi -rm -f pdftests/fn*-euc.tex pdftests/fn*-sjis.tex -if [ "$COMSPEC" != "" ]; then +if [ "$COMSPEC" != "" ] || [ "$ExeExt" = ".exe" ]; then echo "*** We guess OS is Windows." command_line_encoding=utf8 export command_line_encoding 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 77 +fi +rm -f $testdir/fn*-euc.tex $testdir/fn*-sjis.tex fenc="utf8" for doc in fn-$fenc fn£¥µÆÇñß-$fenc fnさざ波-$fenc; do echo '>>> Document:'$doc ' File Encoding:'$fenc - ./pdftex -ini -interaction nonstopmode -jobname=$doc --shell-escape $doc.tex >pdftests/$doc-term.log || rc=1 - mv $doc.txt $doc.log pdftests/ + $_kpsewhich -progname=$engine $doc.tex || rc=10 + $_kpsewhich -progname=$engine fn±×÷§¶-utf8.tex || rc=11 + $_tex -ini -interaction nonstopmode -jobname=$doc --shell-escape $doc.tex >$testdir/$doc-term.log || \ + { rc=1 ; err1=$err1" $fenc:$doc" ; } + $_kpsewhich -progname=$engine $doc-tmp.tex || rc=12 + $_kpsewhich -progname=$engine fn±×÷§¶-utf8-tmp.tex || rc=13 + mv $doc.txt $doc.log $testdir/ ## It does not work. -## diff pdftests/$doc.txt $srcdir/tests/fn-$enc.txt || rc=2 +## diff $testdir/$doc.txt $srcdir/tests/fn-$fenc.txt || \ +## { rc=2 ; err2=$err2" $fenc:$doc" ; } done +if [ $rc -gt 0 ]; then + if [ -n "$err1" ]; then echo ERROR1 $err1; fi + if [ -n "$err2" ]; then echo ERROR2 $err2; fi +else + echo PASS +fi exit $rc diff --git a/Build/source/texk/web2c/pdftexdir/wprob.test b/Build/source/texk/web2c/pdftexdir/wprob.test index 893e65316fc..1c3b0f1934a 100755 --- a/Build/source/texk/web2c/pdftexdir/wprob.test +++ b/Build/source/texk/web2c/pdftexdir/wprob.test @@ -4,6 +4,10 @@ # Copyright 2011-2013 Peter Breitenlohner <tex-live@tug.org> # You may freely use, modify and/or distribute this file. +BinDir=${BinDir:-.} +ExeExt=${ExeExt:-} +_pdftex=$BinDir/pdftex$ExeExt + rm -rf pwprob.* cp "$srcdir/tests/wprob.tex" ./pwprob.tex || exit 1 |