diff options
author | Takuji Tanaka <ttk@t-lab.opal.ne.jp> | 2023-08-20 14:27:12 +0000 |
---|---|---|
committer | Takuji Tanaka <ttk@t-lab.opal.ne.jp> | 2023-08-20 14:27:12 +0000 |
commit | ffd98d9ee172cecc1cb1e5a42f0aec367f401e46 (patch) | |
tree | 51fbc680857785d24fb24b363ac9196c3c1c2ae4 /Build | |
parent | 93a4e8c6daed9a541c27bcaa86bf18851a8c4f0c (diff) |
xetex: Make easier to test on Windows
git-svn-id: svn://tug.org/texlive/trunk@67992 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r-- | Build/source/texk/web2c/xetexdir/ChangeLog | 5 | ||||
-rwxr-xr-x | Build/source/texk/web2c/xetexdir/wcfname.test | 74 | ||||
-rwxr-xr-x | Build/source/texk/web2c/xetexdir/xetex-bug73.test | 12 | ||||
-rwxr-xr-x | Build/source/texk/web2c/xetexdir/xetex-filedump.test | 10 | ||||
-rwxr-xr-x | Build/source/texk/web2c/xetexdir/xetex.test | 6 |
5 files changed, 86 insertions, 21 deletions
diff --git a/Build/source/texk/web2c/xetexdir/ChangeLog b/Build/source/texk/web2c/xetexdir/ChangeLog index be5d17862cc..b33e37e60e8 100644 --- a/Build/source/texk/web2c/xetexdir/ChangeLog +++ b/Build/source/texk/web2c/xetexdir/ChangeLog @@ -1,3 +1,8 @@ +2023-08-20 TANAKA Takuji <ttk@t-lab.opal.ne.jp> + + * {wcfname,xetex-bug73,xetex-filedump,xetex}.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/xetexdir/wcfname.test b/Build/source/texk/web2c/xetexdir/wcfname.test index 7cd4bade012..a07d88b37e1 100755 --- a/Build/source/texk/web2c/xetexdir/wcfname.test +++ b/Build/source/texk/web2c/xetexdir/wcfname.test @@ -3,36 +3,84 @@ # Copyright 2022-2023 Japanese TeX Development Community <issue@texjp.org> # You may freely use, modify and/or distribute this file. -test -d xetests || mkdir -p xetests -rm -f xetests/fn*.log xetests/fn*.txt xetests/fn*.tex fn*.tex +engine=xetex +testdir=xetests -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=xetests:.; export TEXINPUTS +TEXINPUTS="$testdir;."; export TEXINPUTS -perl $srcdir/tests/fn-generate.perl xetests -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 xetests/fn*-euc.tex xetests/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 - ./xetex -ini -interaction nonstopmode -jobname=$doc --shell-escape $doc.tex >xetests/$doc-term.log || rc=1 - mv $doc.txt $doc.log xetests/ - diff xetests/$doc.txt $srcdir/tests/fn-utf8.txt || rc=2 + $_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/ + diff $testdir/$doc.txt $srcdir/tests/fn-utf8.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/xetexdir/xetex-bug73.test b/Build/source/texk/web2c/xetexdir/xetex-bug73.test index 6f2c1f127c9..9230cd8162b 100755 --- a/Build/source/texk/web2c/xetexdir/xetex-bug73.test +++ b/Build/source/texk/web2c/xetexdir/xetex-bug73.test @@ -3,10 +3,14 @@ # Copyright 2014-2015 Peter Breitenlohner <tex-live@tug.org> # You may freely use, modify and/or distribute this file. +BinDir=${BinDir:-.} +ExeExt=${ExeExt:-} +_xetex=$BinDir/xetex$ExeExt + LC_ALL=C; export LC_ALL; LANGUAGE=C; export LANGUAGE TEXMFCNF=$srcdir/../kpathsea;export TEXMFCNF -TEXINPUTS=.:$srcdir/tests; export TEXINPUTS +TEXINPUTS=".;$srcdir/tests"; export TEXINPUTS TEXFORMATS=.; export TEXFORMATS # get same filename in log @@ -15,11 +19,11 @@ $LN_S $srcdir/xetexdir/tests/bug73.tex . #exit 77 -./xetex -ini bug73 || exit 1 +$_xetex -ini bug73 || exit 1 -./xetex -fmt=bug73 bug73 || exit 1 +$_xetex -fmt=bug73 bug73 || exit 2 sed 1d bug73.log >bug73.out -diff $srcdir/xetexdir/tests/bug73.log bug73.out || exit 1 +diff $srcdir/xetexdir/tests/bug73.log bug73.out || exit 3 diff --git a/Build/source/texk/web2c/xetexdir/xetex-filedump.test b/Build/source/texk/web2c/xetexdir/xetex-filedump.test index 1d1a2e75106..a0f667e3575 100755 --- a/Build/source/texk/web2c/xetexdir/xetex-filedump.test +++ b/Build/source/texk/web2c/xetexdir/xetex-filedump.test @@ -2,10 +2,14 @@ # Copyright 2019 Karl Berry <tex-live@tug.org> # You may freely use, modify and/or distribute this file. +BinDir=${BinDir:-.} +ExeExt=${ExeExt:-} +_xetex=$BinDir/xetex$ExeExt + LC_ALL=C; export LC_ALL; LANGUAGE=C; export LANGUAGE TEXMFCNF=$srcdir/../kpathsea;export TEXMFCNF -TEXINPUTS=.:$srcdir/tests; export TEXINPUTS +TEXINPUTS=".;$srcdir/tests"; export TEXINPUTS TEXFORMATS=.; export TEXFORMATS # get same filename in log @@ -14,9 +18,9 @@ $LN_S $srcdir/xetexdir/tests/filedump.tex . #exit 77 -./xetex -ini filedump || exit 1 +$_xetex -ini filedump || exit 1 sed 1d filedump.log >filedump.out -diff $srcdir/xetexdir/tests/filedump.log filedump.out || exit 1 +diff $srcdir/xetexdir/tests/filedump.log filedump.out || exit 2 diff --git a/Build/source/texk/web2c/xetexdir/xetex.test b/Build/source/texk/web2c/xetexdir/xetex.test index d1a6182ae5a..769346f3211 100755 --- a/Build/source/texk/web2c/xetexdir/xetex.test +++ b/Build/source/texk/web2c/xetexdir/xetex.test @@ -5,5 +5,9 @@ # Not really a test, just making sure the program executes. -./xetex -version || exit 1 +BinDir=${BinDir:-.} +ExeExt=${ExeExt:-} +_xetex=$BinDir/xetex$ExeExt + +$_xetex -version || exit 1 |