texlive[67880] Build/source/texk/kpathsea: kpathsea: update tests

commits+takuji at tug.org commits+takuji at tug.org
Fri Aug 11 13:46:24 CEST 2023


Revision: 67880
          http://tug.org/svn/texlive?view=revision&revision=67880
Author:   takuji
Date:     2023-08-11 13:46:24 +0200 (Fri, 11 Aug 2023)
Log Message:
-----------
kpathsea: update tests

Modified Paths:
--------------
    trunk/Build/source/texk/kpathsea/ChangeLog
    trunk/Build/source/texk/kpathsea/tests/cnfline.test
    trunk/Build/source/texk/kpathsea/tests/cnfnewline.test
    trunk/Build/source/texk/kpathsea/tests/cnfnull.test
    trunk/Build/source/texk/kpathsea/tests/cnfprog.test
    trunk/Build/source/texk/kpathsea/tests/kpsestat.test
    trunk/Build/source/texk/kpathsea/tests/kpsewhich.test

Added Paths:
-----------
    trunk/Build/source/texk/kpathsea/tests/windows/
    trunk/Build/source/texk/kpathsea/tests/windows/texmf.cnf

Modified: trunk/Build/source/texk/kpathsea/ChangeLog
===================================================================
--- trunk/Build/source/texk/kpathsea/ChangeLog	2023-08-11 11:46:19 UTC (rev 67879)
+++ trunk/Build/source/texk/kpathsea/ChangeLog	2023-08-11 11:46:24 UTC (rev 67880)
@@ -1,3 +1,12 @@
+2023-08-11  TANAKA Takuji  <ttk at t-lab.opal.ne.jp>
+
+	* tests/{cnfline,cnfnewline,cnfnull,cnfprog,kpsestat,kpsewhich}.test:
+	Make easier to test on Windows.
+	{kpseaccess,kpsereadlink}.test are not modified since
+	they are not used for tests on Windows.
+	* tests/windows/texmf.cnf:
+	New cnf for testing windows MS Visual C build.
+
 2023-07-16  TANAKA Takuji  <ttk at t-lab.opal.ne.jp>
 
 	* kpsewhich.c: Allow Unicode file name for bibtex8 and bibtexu

Modified: trunk/Build/source/texk/kpathsea/tests/cnfline.test
===================================================================
--- trunk/Build/source/texk/kpathsea/tests/cnfline.test	2023-08-11 11:46:19 UTC (rev 67879)
+++ trunk/Build/source/texk/kpathsea/tests/cnfline.test	2023-08-11 11:46:24 UTC (rev 67880)
@@ -3,6 +3,10 @@
 # Copyright 2019 Karl Berry <tex-live at tug.org>
 # You may freely use, modify and/or distribute this file.
 
+BinDir=${BinDir:-.}
+ExeExt=${ExeExt:-}
+_kpsewhich=$BinDir/kpsewhich$ExeExt
+
 cnf_dir=$srcdir/tests/cnfline
 
 # just in case they are set in the environment
@@ -9,23 +13,34 @@
 unset maxpr
 unset othervar
 
+remove_cr() {
+  if [ $ExeExt = ".exe" ]; then
+    val=`echo $val | sed -e 's/\\r//'`
+  fi
+}
+
 # Just for fun, let's first try the --cnf-line feature to set TEXMFCNF.
-val=`./kpsewhich "--cnf-line=TEXMFCNF=$cnf_dir" --var-value=othervar`
+val=`$_kpsewhich "--cnf-line=TEXMFCNF=$cnf_dir" --var-value=othervar`; remove_cr
 test x"$val" = x300 || exit 1
 
 # But for the rest, just use the environment, to keep things simpler.
 TEXMFCNF=$cnf_dir; export TEXMFCNF
+# In Windows, exe binaries fail to get environment variables from sh scripts
+# and still we need --cnf-line.
+if [ $ExeExt = ".exe" ]; then
+  _kpsewhich="$BinDir/kpsewhich$ExeExt --cnf-line=TEXMFCNF=$cnf_dir"
+fi
 
 # Make sure we get expected values from the test texmf.cnf.
-val=`./kpsewhich --var-value=maxpr`
-test x"$val" = x200 || exit 1
+val=`$_kpsewhich --var-value=maxpr`; remove_cr
+test x"$val" = x200 || exit 2
 #
-val=`./kpsewhich --progname=foo --var-value=maxpr`
-test x"$val" = x100 || exit 1
+val=`$_kpsewhich --progname=foo --var-value=maxpr`; remove_cr
+test x"$val" = x100 || exit 3
 #
-val=`./kpsewhich --var-value=othervar`
-test x"$val" = x300 || exit 1
+val=`$_kpsewhich --var-value=othervar`; remove_cr
+test x"$val" = x300 || exit 4
 
 # Now override on cmd line -- both texmf.cnf values should get overridden.
-val=`./kpsewhich --cnf-line=maxpr=99 --var-value=maxpr`
-test x"$val" = x99 || exit 1
+val=`$_kpsewhich --cnf-line=maxpr=99 --var-value=maxpr`; remove_cr
+test x"$val" = x99 || exit 5

Modified: trunk/Build/source/texk/kpathsea/tests/cnfnewline.test
===================================================================
(Binary files differ)

Modified: trunk/Build/source/texk/kpathsea/tests/cnfnull.test
===================================================================
--- trunk/Build/source/texk/kpathsea/tests/cnfnull.test	2023-08-11 11:46:19 UTC (rev 67879)
+++ trunk/Build/source/texk/kpathsea/tests/cnfnull.test	2023-08-11 11:46:24 UTC (rev 67880)
@@ -5,6 +5,10 @@
 # 
 # Test nul (zero) bytes in texmf.cnf.
 
+BinDir=${BinDir:-.}
+ExeExt=${ExeExt:-}
+_kpsewhich=$BinDir/kpsewhich$ExeExt
+
 cnf_dir=cnfnull
 cnf_file=$cnf_dir/texmf.cnf
 
@@ -13,10 +17,11 @@
 rm -rf $cnf_dir
 mkdir $cnf_dir
 test -d $cnf_dir || exit 1
-printf 'x\0=1\n\0' >$cnf_file || exit 1
+printf 'x\0=1\n\0' >$cnf_file || exit 2
 
-val=`./kpsewhich "--cnf-line=TEXMFCNF=$cnf_dir" --var-value=x`
-test x"$val" = x1 || exit 1
+val=`$_kpsewhich "--cnf-line=TEXMFCNF=$cnf_dir" --var-value=x`
+if [ $exe = ".exe" ]; then val=`echo $val | sed -e 's/\\r//'`; fi
+test x"$val" = x1 || exit 3
 
 # Before we dropped nul bytes in 2020, kpse gave a warning:
 #   warning: cnfnull/texmf.cnf:1: (kpathsea) No cnf value on line: x.

Modified: trunk/Build/source/texk/kpathsea/tests/cnfprog.test
===================================================================
--- trunk/Build/source/texk/kpathsea/tests/cnfprog.test	2023-08-11 11:46:19 UTC (rev 67879)
+++ trunk/Build/source/texk/kpathsea/tests/cnfprog.test	2023-08-11 11:46:24 UTC (rev 67880)
@@ -4,6 +4,10 @@
 # You may freely use, modify and/or distribute this file.
 # Test strange program name qualifiers which should give warnings.
 
+BinDir=${BinDir:-.}
+ExeExt=${ExeExt:-}
+_kpsewhich=$BinDir/kpsewhich$ExeExt
+
 cnf_dir=$srcdir/tests/cnfprog
 
 # But for the rest, just use the environment, to keep things simpler.
@@ -11,13 +15,14 @@
 
 # Make sure we get expected values from the test texmf.cnf.
 errfile=cnfprog.err
-val=`./kpsewhich --var-value=noequals 2>$errfile`
+val=`$_kpsewhich "--cnf-line=TEXMFCNF=$cnf_dir" --var-value=noequals 2>$errfile`
+if [ $ExeExt = ".exe" ]; then val=`echo $val | sed -e 's/\\r//'`; fi
 
 # the vaiable should not have any value.
 test -z "$val" || exit 1
 
-grep 'Empty program name qualifier' $errfile || exit 1
-grep 'Unlikely character ;' $errfile || exit 1
-grep 'Unlikely character \$' $errfile || exit 1
+grep 'Empty program name qualifier' $errfile || exit 2
+grep 'Unlikely character ;' $errfile || exit 3
+grep 'Unlikely character \$' $errfile || exit 4
 
 exit 0

Modified: trunk/Build/source/texk/kpathsea/tests/kpsestat.test
===================================================================
--- trunk/Build/source/texk/kpathsea/tests/kpsestat.test	2023-08-11 11:46:19 UTC (rev 67879)
+++ trunk/Build/source/texk/kpathsea/tests/kpsestat.test	2023-08-11 11:46:24 UTC (rev 67880)
@@ -4,17 +4,20 @@
 # Copyright 2010 Peter Breitenlohner <tex-live at tug.org>
 # You may freely use, modify and/or distribute this file.
 
-./kpsestat = nonesuch 2>/dev/null && exit 1
+BinDir=${BinDir:-.}
+ExeExt=${ExeExt:-}
+_kpsestat=$BinDir/kpsestat$ExeExt
 
+$_kpsestat = nonesuch 2>/dev/null && exit 1
+
 for f in . kpsestat kpsestat.o; do
-  echo "kpsestat = $f => `./kpsestat = $f`"
+  echo "kpsestat = $f => `$_kpsestat = $f`"
 done
 
 for m in -rw g-r u-w o+x -rw,u+s -rw,g+s -rw,o+t; do
-  echo "kpsestat $m kpsestat.o => `./kpsestat $m kpsestat.o`"
+  echo "kpsestat $m kpsestat.o => `$_kpsestat $m kpsestat.o`"
 done
 
-echo "kpsestat = \$srcdir => `./kpsestat = $srcdir`"
-echo "kpsestat = \$srcdir/ => `./kpsestat = $srcdir/`"
-echo "kpsestat = \$srcdir/kpsestat.c => `./kpsestat = $srcdir/kpsestat.c`"
-
+echo "kpsestat = \$srcdir => `$_kpsestat = $srcdir`"
+echo "kpsestat = \$srcdir/ => `$_kpsestat = $srcdir/`"
+echo "kpsestat = \$srcdir/kpsestat.c => `$_kpsestat = $srcdir/kpsestat.c`"

Modified: trunk/Build/source/texk/kpathsea/tests/kpsewhich.test
===================================================================
--- trunk/Build/source/texk/kpathsea/tests/kpsewhich.test	2023-08-11 11:46:19 UTC (rev 67879)
+++ trunk/Build/source/texk/kpathsea/tests/kpsewhich.test	2023-08-11 11:46:24 UTC (rev 67880)
@@ -4,32 +4,63 @@
 # Copyright 2010-2013 Peter Breitenlohner <tex-live at tug.org>
 # You may freely use, modify and/or distribute this file.
 
+BinDir=${BinDir:-.}
+ExeExt=${ExeExt:-}
+_kpsewhich=$BinDir/kpsewhich$ExeExt
+
 TEXMFCNF=$srcdir
 export TEXMFCNF
 
-./kpsewhich --var-value=TEXMFCNF || exit 1  # environment variable
-./kpsewhich --var-value=TEXMFMAIN || exit 1
-./kpsewhich --expand-var=\$TEXMFMAIN || exit 1
+$_kpsewhich --var-value=TEXMFCNF || exit 1  # environment variable
+$_kpsewhich --var-value=TEXMFMAIN || exit 2
+$_kpsewhich --expand-var=\$TEXMFMAIN || exit 3
 
 # It turns out --all and no --all go through rather different code
 # in pathsearch.c, so try them both.
+
+if [ $ExeExt = ".exe" ]; then
+
+$_kpsewhich --cnf-line=TEXINPUTS=$srcdir/../tests/texmf \
+    --casefold-search --all Plain.TeX || exit 4
+$_kpsewhich --cnf-line=TEXINPUTS=$srcdir/../tests/texmf \
+    --casefold-search Plain.TeX || exit 5
+
+else
+
 TEXINPUTS=$srcdir/../tests/texmf \
-  ./kpsewhich --casefold-search --all Plain.TeX || exit 1
+  $_kpsewhich --casefold-search --all Plain.TeX || exit 4
 TEXINPUTS=$srcdir/../tests/texmf \
-  ./kpsewhich --casefold-search Plain.TeX || exit 1
+  $_kpsewhich --casefold-search Plain.TeX || exit 5
+
+fi
 #
 # These runs will succeed on case-insensitive (file)systems, so don't
 # run them.
 #TEXINPUTS=$srcdir/../tests/texmf \
-#  ./kpsewhich --no-casefold-search --all Plain.TeX && exit 1
+#  ./kpsewhich --no-casefold-search --all Plain.TeX && exit 6
 #TEXINPUTS=$srcdir/../tests/texmf \
-#  ./kpsewhich --no-casefold-search Plain.TeX && exit 1
+#  ./kpsewhich --no-casefold-search Plain.TeX && exit 7
 
+if [ $ExeExt = ".exe" ]; then
+
+$_kpsewhich --cnf-line=TEXINPUTS=$srcdir/../tests/texmf \
+    --all plain || exit 8
+
+$_kpsewhich --cnf-line=AFMFONTS=$srcdir/../tests/texmf \
+    afmtest.afm || exit 9
+
+$_kpsewhich --cnf-line=BSTINPUTS=$srcdir/../tests/texmf \
+    plain.bst || exit 10
+
+else
+
 TEXINPUTS=$srcdir/../tests/texmf \
-  ./kpsewhich --all plain || exit 1
+  $_kpsewhich --all plain || exit 8
 
 AFMFONTS=$srcdir/../tests/texmf \
-  ./kpsewhich afmtest.afm || exit 1
+  $_kpsewhich afmtest.afm || exit 9
 
 BSTINPUTS=$srcdir/../tests/texmf \
-  ./kpsewhich plain.bst || exit 1
+  $_kpsewhich plain.bst || exit 10
+
+fi

Added: trunk/Build/source/texk/kpathsea/tests/windows/texmf.cnf
===================================================================
--- trunk/Build/source/texk/kpathsea/tests/windows/texmf.cnf	                        (rev 0)
+++ trunk/Build/source/texk/kpathsea/tests/windows/texmf.cnf	2023-08-11 11:46:24 UTC (rev 67880)
@@ -0,0 +1,49 @@
+% Public domain.
+% This tiny texmf.cnf is for testing windows MS Visual C build
+
+TEXMFMAIN = $TEXMFCNF
+
+TEXINPUTS = .;$srcroot/texk/bibtex-x/tests
+TEXFONTS = .;$srcroot/texk/dvipsk/testdata
+
+% for web2c
+CWEBINPUTS = $srcroot/texk/web2c/ctiedir;$srcroot/texk/web2c/cwebdir//
+WEBINPUTS = $srcroot/texk/web2c/tiedir
+
+% for dvips
+TEXFONTMAPS.dvips = $srcroot/texk/dvipsk/testdata
+VFFONTS.dvips = .;$srcroot/texk/dvipsk/testdata
+TEXPSHEADERS.dvips = .;$srcroot/texk/dvipsk/testdata
+TEXFONTS.dvips = .;$srcroot/texk/dvipsk/testdata
+TFMFONTS.dvips = .;$srcroot/texk/{web2c/tests,dvipsk/testdata}//
+TEXFONTS.dvips = .;$srcroot/texk/{web2c/tests,dvipsk/testdata}//
+T1FONTS.dvips = .;$srcroot/texk/{web2c/tests,dvipsk/testdata}//
+AFMFONTS.afm2tfm = $srcroot/texk/tests/texmf
+
+% for dvipdfm-x
+TFMFONTS.dvipdfmx = .;$srcroot/texk/dvipdfm-x/tests;$srcroot/texk/dvipdfm-x/data
+T1FONTS.dvipdfmx = .;$srcroot/texk/dvipdfm-x/tests;$srcroot/texk/dvipdfm-x/data
+TTFONTS.dvipdfmx = .;$srcroot/texk/dvipdfm-x/tests;$srcroot/texk/dvipdfm-x/data
+PKFONTS.dvipdfmx = .;$srcroot/texk/dvipdfm-x/tests;$srcroot/texk/dvipdfm-x/data
+TEXFONTMAPS.dvipdfmx = .;$srcroot/texk/dvipdfm-x/tests;$srcroot/texk/dvipdfm-x/data
+DVIPDFMXINPUTS.dvipdfmx = .;$srcroot/texk/dvipdfm-x/tests;$srcroot/texk/dvipdfm-x/data
+TEXPICTS.dvipdfmx = $srcroot/texk/dvipdfm-x/tests
+TEXFONTS.dvipdfmx = .;$srcroot/texk/dvipdfm-x/tests
+
+% for bibtex-x
+BIBINPUTS.bibtex8 = .;$srcroot/texk/web2c/tests;$srcroot/texk/bibtex-x/tests
+BSTINPUTS.bibtex8 = .;$srcroot/texk/tests/texmf;$srcroot/texk/web2c/tests;$srcroot/texk/bibtex-x/{tests,csf}
+BIBINPUTS.bibtexu = .;$srcroot/texk/web2c/tests;$srcroot/texk/bibtex-x/tests
+BSTINPUTS.bibtexu = .;$srcroot/texk/tests/texmf;$srcroot/texk/web2c/tests;$srcroot/texk/bibtex-x/tests
+
+% Guess input encoding (SJIS vs. Unicode, etc.) in pTeX and friends
+guess_input_kanji_encoding = 0
+guess_input_kanji_encoding.ptex = 1
+guess_input_kanji_encoding.eptex = 1
+guess_input_kanji_encoding.platex = 1
+guess_input_kanji_encoding.platex-dev = 1
+guess_input_kanji_encoding.pbibtex = 1
+guess_input_kanji_encoding.mendex = 1
+
+% command_line_encoding
+command_line_encoding = utf-8



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