texlive[67992] Build/source/texk/web2c/xetexdir: xetex: Make easier

commits+takuji at tug.org commits+takuji at tug.org
Sun Aug 20 16:27:12 CEST 2023


Revision: 67992
          http://tug.org/svn/texlive?view=revision&revision=67992
Author:   takuji
Date:     2023-08-20 16:27:12 +0200 (Sun, 20 Aug 2023)
Log Message:
-----------
xetex: Make easier to test on Windows

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/xetexdir/ChangeLog
    trunk/Build/source/texk/web2c/xetexdir/wcfname.test
    trunk/Build/source/texk/web2c/xetexdir/xetex-bug73.test
    trunk/Build/source/texk/web2c/xetexdir/xetex-filedump.test
    trunk/Build/source/texk/web2c/xetexdir/xetex.test

Modified: trunk/Build/source/texk/web2c/xetexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/xetexdir/ChangeLog	2023-08-20 14:27:05 UTC (rev 67991)
+++ trunk/Build/source/texk/web2c/xetexdir/ChangeLog	2023-08-20 14:27:12 UTC (rev 67992)
@@ -1,3 +1,8 @@
+2023-08-20  TANAKA Takuji  <ttk at t-lab.opal.ne.jp>
+
+	* {wcfname,xetex-bug73,xetex-filedump,xetex}.test:
+	Make easier to test on Windows.
+
 2023-03-29  TANAKA Takuji  <ttk at t-lab.opal.ne.jp>
 
 	* wcfname.test:

Modified: trunk/Build/source/texk/web2c/xetexdir/wcfname.test
===================================================================
--- trunk/Build/source/texk/web2c/xetexdir/wcfname.test	2023-08-20 14:27:05 UTC (rev 67991)
+++ trunk/Build/source/texk/web2c/xetexdir/wcfname.test	2023-08-20 14:27:12 UTC (rev 67992)
@@ -3,36 +3,84 @@
 # Copyright 2022-2023 Japanese TeX Development Community <issue at 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

Modified: trunk/Build/source/texk/web2c/xetexdir/xetex-bug73.test
===================================================================
--- trunk/Build/source/texk/web2c/xetexdir/xetex-bug73.test	2023-08-20 14:27:05 UTC (rev 67991)
+++ trunk/Build/source/texk/web2c/xetexdir/xetex-bug73.test	2023-08-20 14:27:12 UTC (rev 67992)
@@ -3,10 +3,14 @@
 # Copyright 2014-2015 Peter Breitenlohner <tex-live at 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 @@
 
 #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
 

Modified: trunk/Build/source/texk/web2c/xetexdir/xetex-filedump.test
===================================================================
--- trunk/Build/source/texk/web2c/xetexdir/xetex-filedump.test	2023-08-20 14:27:05 UTC (rev 67991)
+++ trunk/Build/source/texk/web2c/xetexdir/xetex-filedump.test	2023-08-20 14:27:12 UTC (rev 67992)
@@ -2,10 +2,14 @@
 # Copyright 2019 Karl Berry <tex-live at 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 @@
 
 #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
 

Modified: trunk/Build/source/texk/web2c/xetexdir/xetex.test
===================================================================
--- trunk/Build/source/texk/web2c/xetexdir/xetex.test	2023-08-20 14:27:05 UTC (rev 67991)
+++ trunk/Build/source/texk/web2c/xetexdir/xetex.test	2023-08-20 14:27:12 UTC (rev 67992)
@@ -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
+



More information about the tex-live-commits mailing list.