diff options
author | Takuji Tanaka <ttk@t-lab.opal.ne.jp> | 2023-08-11 11:46:24 +0000 |
---|---|---|
committer | Takuji Tanaka <ttk@t-lab.opal.ne.jp> | 2023-08-11 11:46:24 +0000 |
commit | d56a36802274eb69e3134d69aefac666a258cfd7 (patch) | |
tree | 4c02a0d8db02e5850b3dcb5a0e769ebb287503f9 /Build/source | |
parent | 5e75cab8937ab440b35d26d8b6b518fcd3127bce (diff) |
kpathsea: update tests
git-svn-id: svn://tug.org/texlive/trunk@67880 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source')
-rw-r--r-- | Build/source/texk/kpathsea/ChangeLog | 9 | ||||
-rwxr-xr-x | Build/source/texk/kpathsea/tests/cnfline.test | 33 | ||||
-rwxr-xr-x | Build/source/texk/kpathsea/tests/cnfnewline.test | 8 | ||||
-rwxr-xr-x | Build/source/texk/kpathsea/tests/cnfnull.test | 11 | ||||
-rwxr-xr-x | Build/source/texk/kpathsea/tests/cnfprog.test | 13 | ||||
-rwxr-xr-x | Build/source/texk/kpathsea/tests/kpsestat.test | 17 | ||||
-rwxr-xr-x | Build/source/texk/kpathsea/tests/kpsewhich.test | 51 | ||||
-rw-r--r-- | Build/source/texk/kpathsea/tests/windows/texmf.cnf | 49 |
8 files changed, 157 insertions, 34 deletions
diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog index 80e7d9a00b2..738b1c0acfa 100644 --- a/Build/source/texk/kpathsea/ChangeLog +++ b/Build/source/texk/kpathsea/ChangeLog @@ -1,3 +1,12 @@ +2023-08-11 TANAKA Takuji <ttk@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@t-lab.opal.ne.jp> * kpsewhich.c: Allow Unicode file name for bibtex8 and bibtexu diff --git a/Build/source/texk/kpathsea/tests/cnfline.test b/Build/source/texk/kpathsea/tests/cnfline.test index 076d9a78281..dcc2b0539a7 100755 --- a/Build/source/texk/kpathsea/tests/cnfline.test +++ b/Build/source/texk/kpathsea/tests/cnfline.test @@ -3,29 +3,44 @@ # Copyright 2019 Karl Berry <tex-live@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 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 diff --git a/Build/source/texk/kpathsea/tests/cnfnewline.test b/Build/source/texk/kpathsea/tests/cnfnewline.test index 9d93984d8f5..090f66ebadb 100755 --- a/Build/source/texk/kpathsea/tests/cnfnewline.test +++ b/Build/source/texk/kpathsea/tests/cnfnewline.test @@ -4,9 +4,15 @@ # Copyright 2013 Peter Breitenlohner <tex-live@tug.org> # You may freely use, modify and/or distribute this file. +BinDir=${BinDir:-.} +ExeExt=${ExeExt:-} +_kpsewhich=$BinDir/kpsewhich$ExeExt + TEXMFCNF=$srcdir/tests/cnfnewline; export TEXMFCNF +cnf_dir=$srcdir/tests/cnfnewline -val=`./kpsewhich --debug=-1 --var-value=lastvar` +val=`$_kpsewhich "--cnf-line=TEXMFCNF=$cnf_dir" --debug=-1 --var-value=lastvar` +if [ $ExeExt = ".exe" ]; then val=`echo $val | sed -e 's/\\r//'`; fi test x"$val" = xlastval || exit 1 # verbose for testing. diff --git a/Build/source/texk/kpathsea/tests/cnfnull.test b/Build/source/texk/kpathsea/tests/cnfnull.test index e80d931394c..e84fe35a124 100755 --- a/Build/source/texk/kpathsea/tests/cnfnull.test +++ b/Build/source/texk/kpathsea/tests/cnfnull.test @@ -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 @@ cnf_file=$cnf_dir/texmf.cnf 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. diff --git a/Build/source/texk/kpathsea/tests/cnfprog.test b/Build/source/texk/kpathsea/tests/cnfprog.test index 08f472e2b34..112f62e82df 100755 --- a/Build/source/texk/kpathsea/tests/cnfprog.test +++ b/Build/source/texk/kpathsea/tests/cnfprog.test @@ -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 @@ TEXMFCNF=$cnf_dir; export TEXMFCNF # 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 diff --git a/Build/source/texk/kpathsea/tests/kpsestat.test b/Build/source/texk/kpathsea/tests/kpsestat.test index fa25f5a5968..b3105d0ad62 100755 --- a/Build/source/texk/kpathsea/tests/kpsestat.test +++ b/Build/source/texk/kpathsea/tests/kpsestat.test @@ -4,17 +4,20 @@ # Copyright 2010 Peter Breitenlohner <tex-live@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`" diff --git a/Build/source/texk/kpathsea/tests/kpsewhich.test b/Build/source/texk/kpathsea/tests/kpsewhich.test index 261bf1b17f3..5c23e940aa4 100755 --- a/Build/source/texk/kpathsea/tests/kpsewhich.test +++ b/Build/source/texk/kpathsea/tests/kpsewhich.test @@ -4,32 +4,63 @@ # Copyright 2010-2013 Peter Breitenlohner <tex-live@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 diff --git a/Build/source/texk/kpathsea/tests/windows/texmf.cnf b/Build/source/texk/kpathsea/tests/windows/texmf.cnf new file mode 100644 index 00000000000..0e57e7c871f --- /dev/null +++ b/Build/source/texk/kpathsea/tests/windows/texmf.cnf @@ -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 |