From e0f67bd3c0d0119644ada3665551b250d61e1af6 Mon Sep 17 00:00:00 2001 From: Takuji Tanaka Date: Fri, 11 Aug 2023 11:46:28 +0000 Subject: bibtex-x: update tests git-svn-id: svn://tug.org/texlive/trunk@67881 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/bibtex-x/tests/bibtex8-char.test | 18 ++++++----- Build/source/texk/bibtex-x/tests/bibtex8-sort.test | 8 +++-- Build/source/texk/bibtex-x/tests/bibtex8.test | 14 +++++---- Build/source/texk/bibtex-x/tests/bibtex8u-mem.test | 13 +++++--- .../source/texk/bibtex-x/tests/bibtexu-basic.test | 13 ++++++-- Build/source/texk/bibtex-x/tests/bibtexu-char.test | 35 +++++++++++++++++----- .../source/texk/bibtex-x/tests/bibtexu-range.test | 8 ++++- Build/source/texk/bibtex-x/tests/bibtexu-sort.test | 8 +++-- .../source/texk/bibtex-x/tests/bibtexu-yannis.test | 8 ++++- Build/source/texk/bibtex-x/tests/bibtexu.test | 12 +++++--- 10 files changed, 100 insertions(+), 37 deletions(-) (limited to 'Build/source/texk/bibtex-x/tests') diff --git a/Build/source/texk/bibtex-x/tests/bibtex8-char.test b/Build/source/texk/bibtex-x/tests/bibtex8-char.test index 06d5e41af3c..b85ba9d700f 100755 --- a/Build/source/texk/bibtex-x/tests/bibtex8-char.test +++ b/Build/source/texk/bibtex-x/tests/bibtex8-char.test @@ -3,44 +3,48 @@ # Copyright 2022 TANAKA Takuji # You may freely use, modify and/or distribute this file. +BinDir=${BinDir:-.} +ExeExt=${ExeExt:-} +_bibtex8=$BinDir/bibtex8$ExeExt + test -d tests || mkdir -p tests rc=0 TEXMFCNF=$srcdir/../kpathsea -BSTINPUTS=$srcdir/tests:$srcdir/csf +BSTINPUTS=$srcdir/{tests,csf} BIBINPUTS=$srcdir/tests export TEXMFCNF BSTINPUTS BIBINPUTS ## test for add.period$ cp $srcdir/tests/perioda.aux tests/xperioda.aux -./bibtex8 tests/xperioda || rc=3 +$_bibtex8 tests/xperioda || rc=3 diff $srcdir/tests/perioda.bbl tests/xperioda.bbl || rc=4 ## test for substring$ cp $srcdir/tests/substra.aux tests/xsubstra.aux -./bibtex8 tests/xsubstra || rc=5 +$_bibtex8 tests/xsubstra || rc=5 diff $srcdir/tests/substra.bbl tests/xsubstra.bbl || rc=6 ## test for text.length$, text.prefix$ cp $srcdir/tests/txtprfxa.aux tests/xtxtprfxa.aux -./bibtex8 tests/xtxtprfxa || rc=7 +$_bibtex8 tests/xtxtprfxa || rc=7 diff $srcdir/tests/txtprfxa.bbl tests/xtxtprfxa.bbl || rc=8 ## test for width$ cp $srcdir/tests/widtha.aux tests/xwidtha.aux -./bibtex8 --csfile sort1.csf tests/xwidtha || rc=9 +$_bibtex8 --csfile sort1.csf tests/xwidtha || rc=9 diff $srcdir/tests/widtha.bbl tests/xwidtha.bbl || rc=10 ## test for chr.to.int$, int.to.str$, int.to.chr$ cp $srcdir/tests/chara.aux tests/xchara.aux -./bibtex8 tests/xchara || rc=11 +$_bibtex8 tests/xchara || rc=11 diff $srcdir/tests/chara.bbl tests/xchara.bbl || rc=12 ## test for num.names$, format.name$ cp $srcdir/tests/namea.aux tests/xnamea.aux -max_print_line=119 ./bibtex8 tests/xnamea || rc=13 +max_print_line=119 $_bibtex8 tests/xnamea || rc=13 diff $srcdir/tests/namea.bbl tests/xnamea.bbl || rc=14 diff --git a/Build/source/texk/bibtex-x/tests/bibtex8-sort.test b/Build/source/texk/bibtex-x/tests/bibtex8-sort.test index 9599b0a18f3..ddc0c05848b 100755 --- a/Build/source/texk/bibtex-x/tests/bibtex8-sort.test +++ b/Build/source/texk/bibtex-x/tests/bibtex8-sort.test @@ -6,6 +6,10 @@ # Using test data from Philipp Lehman +BinDir=${BinDir:-.} +ExeExt=${ExeExt:-} +_bibtex8=$BinDir/bibtex8$ExeExt + test -d tests || mkdir -p tests rc=0 @@ -21,12 +25,12 @@ for i in 1 2 3; do ## test for sorting and change.case$ cp $srcdir/tests/sort.aux tests/xsort$i.aux -./bibtex8 --csfile sort$i.csf tests/xsort$i || rc=1 +$_bibtex8 --csfile sort$i.csf tests/xsort$i || rc=1 diff $srcdir/tests/sort$i.bbl tests/xsort$i.bbl || rc=2 ## test for change.case$ cp $srcdir/tests/casea.aux tests/xcase$i.aux -./bibtex8 --csfile sort$i.csf tests/xcase$i || rc=3 +$_bibtex8 --csfile sort$i.csf tests/xcase$i || rc=3 diff $srcdir/tests/casea.bbl tests/xcase$i.bbl || rc=4 done diff --git a/Build/source/texk/bibtex-x/tests/bibtex8.test b/Build/source/texk/bibtex-x/tests/bibtex8.test index 1950ea94cf0..a5ec719ab47 100755 --- a/Build/source/texk/bibtex-x/tests/bibtex8.test +++ b/Build/source/texk/bibtex-x/tests/bibtex8.test @@ -5,6 +5,10 @@ # Copyright 2023 TANAKA Takuji # You may freely use, modify and/or distribute this file. +BinDir=${BinDir:-.} +ExeExt=${ExeExt:-} +_bibtex8=$BinDir/bibtex8$ExeExt + test -d tests || mkdir -p tests rc=0 @@ -17,31 +21,31 @@ cp $srcdir/../web2c/tests/exampl.aux tests/xexampl.aux || rc=1 TEXMFCNF=$srcdir/../kpathsea \ BSTINPUTS=$srcdir/../web2c/tests \ BIBINPUTS=$srcdir/../web2c/tests \ - ./bibtex8 -7 -s -d all tests/xexampl || test $? = 1 || rc=2 + $_bibtex8 -7 -s -d all tests/xexampl || test $? = 1 || rc=2 diff $srcdir/tests/exampl.bbl tests/xexampl.bbl || rc=3 LC_ALL=C; export LC_ALL; LANGUAGE=C; export LANGUAGE TEXMFCNF=$srcdir/../kpathsea -BSTINPUTS=$srcdir/../web2c/tests +BSTINPUTS=$srcdir/{../web2c/tests,csf} BIBINPUTS=$srcdir/../web2c/tests export TEXMFCNF BSTINPUTS BIBINPUTS cp $srcdir/../web2c/tests/exampl.aux tests/xex_пробный.aux || rc=4 -./bibtex8 -7 -s -d io tests/xex_пробный || test $? = 1 || rc=5 +$_bibtex8 -7 -s -d io tests/xex_пробный || test $? = 1 || rc=5 diff $srcdir/tests/exampl.bbl tests/xex_пробный.bbl || rc=6 cp $srcdir/../web2c/tests/exampl.aux tests/xex_试验.aux || rc=7 -./bibtex8 -7 -s -d io tests/xex_试验 || test $? = 1 || rc=8 +$_bibtex8 -s -d io tests/xex_试验 || test $? = 1 || rc=8 diff $srcdir/tests/exampl.bbl tests/xex_试验.bbl || rc=9 ## not exist, cause fatal error -./bibtex8 -d io tests/xex_δίκη || test $? = 1 && rc=10 +$_bibtex8 -d io tests/xex_δίκη || test $? = 1 && rc=10 exit $rc diff --git a/Build/source/texk/bibtex-x/tests/bibtex8u-mem.test b/Build/source/texk/bibtex-x/tests/bibtex8u-mem.test index f7106e16eaa..7c34b039f70 100755 --- a/Build/source/texk/bibtex-x/tests/bibtex8u-mem.test +++ b/Build/source/texk/bibtex-x/tests/bibtex8u-mem.test @@ -6,6 +6,11 @@ # Using test data from Philipp Lehman +BinDir=${BinDir:-.} +ExeExt=${ExeExt:-} +_bibtex8=$BinDir/bibtex8$ExeExt +_bibtexu=$BinDir/bibtexu$ExeExt + test -d tests || mkdir -p tests # Create bib data @@ -62,16 +67,16 @@ for t in 1 2 3; do eval $env \ TEXMFCNF=$srcdir/../kpathsea \ - BSTINPUTS=$srcdir/../web2c/tests:$srcdir/csf \ + BSTINPUTS=$srcdir/../web2c/tests'\;'$srcdir/csf \ BIBINPUTS=./tests \ - ./bibtex8 -s tests/memtest$t || exit 1 + $_bibtex8 -s tests/memtest$t || exit 1 cp -p tests/memtest$t.aux tests/memtestu$t.aux eval $env \ TEXMFCNF=$srcdir/../kpathsea \ - BSTINPUTS=$srcdir/../web2c/tests:$srcdir/csf \ + BSTINPUTS=$srcdir/../web2c/tests \ BIBINPUTS=./tests \ - ./bibtexu -s tests/memtestu$t || exit 2 + $_bibtexu -s tests/memtestu$t || exit 2 done diff --git a/Build/source/texk/bibtex-x/tests/bibtexu-basic.test b/Build/source/texk/bibtex-x/tests/bibtexu-basic.test index 0db8e5f2953..b827e166101 100755 --- a/Build/source/texk/bibtex-x/tests/bibtexu-basic.test +++ b/Build/source/texk/bibtex-x/tests/bibtexu-basic.test @@ -2,6 +2,10 @@ # $Id: bibtexu-yannis.test 51452 2019-06-25 01:28:47Z karl $ # Public domain. Originally written by Karl Berry, 2021. +BinDir=${BinDir:-.} +ExeExt=${ExeExt:-} +_bibtexu=$BinDir/bibtexu$ExeExt + test -d tests || mkdir -p tests testname=ubasic @@ -16,10 +20,13 @@ TEXMFCNF=$srcdir/../kpathsea; export TEXMFCNF BSTINPUTS=$srcdir/../tests/texmf; export BSTINPUTS BIBINPUTS=$srcdir/tests; export BIBINPUTS -if ./bibtexu -t -d all tests/x$testname; then :; else + +if $_bibtexu -t -d all tests/x$testname; then :; else echo "*** bibtexu failed, tests/x$testname.blg is:" >&2 cat tests/x$testname.blg >&2 - exit 1 + exit 2 fi -diff $srcdir/tests/$testname.bbl tests/x$testname.bbl || exit 1 +diff $srcdir/tests/$testname.bbl tests/x$testname.bbl || exit 3 + +exit 0 diff --git a/Build/source/texk/bibtex-x/tests/bibtexu-char.test b/Build/source/texk/bibtex-x/tests/bibtexu-char.test index ec27840a309..e3b85f0b596 100755 --- a/Build/source/texk/bibtex-x/tests/bibtexu-char.test +++ b/Build/source/texk/bibtex-x/tests/bibtexu-char.test @@ -3,6 +3,10 @@ # Copyright 2022-2023 TANAKA Takuji # You may freely use, modify and/or distribute this file. +BinDir=${BinDir:-.} +ExeExt=${ExeExt:-} +_bibtexu=$BinDir/bibtexu$ExeExt + test -d tests || mkdir tests test -d tests || exit 1 @@ -15,40 +19,55 @@ BIBINPUTS=$srcdir/tests; export BIBINPUTS rc=0 +if [ "$(expr substr $(uname -s) 1 5)" == "MINGW" ]; then + echo "*** skip test $0 on MINGW" + exit $rc +fi + ## test for add.period$ cp $srcdir/tests/periodu.aux tests/xperiodu.aux -./bibtexu tests/xperiodu || rc=3 +$_bibtexu tests/xperiodu || rc=3 diff $srcdir/tests/periodu.bbl tests/xperiodu.bbl || rc=4 ## test for substring$ cp $srcdir/tests/substru.aux tests/xsubstru.aux -./bibtexu tests/xsubstru || rc=5 +$_bibtexu tests/xsubstru || rc=5 diff $srcdir/tests/substru.bbl tests/xsubstru.bbl || rc=6 ## test for text.length$, text.prefix$ cp $srcdir/tests/txtprfxu.aux tests/xtxtprfxu.aux -./bibtexu tests/xtxtprfxu || rc=7 +$_bibtexu tests/xtxtprfxu || rc=7 diff $srcdir/tests/txtprfxu.bbl tests/xtxtprfxu.bbl || rc=8 ## test for width$ ## (FIXME) Greek, Cyrillic are not impremented yet cp $srcdir/tests/widthu.aux tests/xwidthu.aux -./bibtexu tests/xwidthu || rc=9 +$_bibtexu tests/xwidthu || rc=9 diff $srcdir/tests/widthu.bbl tests/xwidthu.bbl || rc=10 ## test for chr.to.int$, int.to.str$, int.to.chr$ cp $srcdir/tests/charu.aux tests/xcharu.aux -./bibtexu tests/xcharu || rc=11 +$_bibtexu tests/xcharu || rc=11 diff $srcdir/tests/charu.bbl tests/xcharu.bbl || rc=12 ## test for num.names$, format.name$ cp $srcdir/tests/nameu.aux tests/xnameu.aux -max_print_line=119 ./bibtexu tests/xnameu || rc=13 +max_print_line=119 $_bibtexu tests/xnameu || rc=13 diff $srcdir/tests/nameu.bbl tests/xnameu.bbl || rc=14 ## test for is.knj.str$ + +DIFF="diff"; icuver=0 +$_bibtexu --version | grep "ICU version 70" && icuver=70 +if [ $icuver -eq 70 ]; then + # skip CJK Ideograph Extension H + # U+31350 -> \360\261\215\220 + uchr='\360\261\215\220' + DIFF="diff --ignore-matching-lines="`printf "${uchr}"` + echo "*** skip checking CJK Ideograph Extension H" +fi cp $srcdir/tests/iscjku.aux tests/xiscjku.aux -./bibtexu tests/xiscjku || rc=15 -diff $srcdir/tests/iscjku.bbl tests/xiscjku.bbl || rc=16 +$_bibtexu tests/xiscjku || rc=15 +$DIFF $srcdir/tests/iscjku.bbl tests/xiscjku.bbl || rc=16 exit $rc diff --git a/Build/source/texk/bibtex-x/tests/bibtexu-range.test b/Build/source/texk/bibtex-x/tests/bibtexu-range.test index 7eefbca6f3e..4a9598a1bf3 100755 --- a/Build/source/texk/bibtex-x/tests/bibtexu-range.test +++ b/Build/source/texk/bibtex-x/tests/bibtexu-range.test @@ -2,6 +2,10 @@ # $Id$ # Public domain. Originally written by Karl Berry, 2021. +BinDir=${BinDir:-.} +ExeExt=${ExeExt:-} +_bibtexu=$BinDir/bibtexu$ExeExt + test -d tests || mkdir -p tests testname=urange @@ -13,10 +17,12 @@ TEXMFCNF=$srcdir/../kpathsea; export TEXMFCNF BSTINPUTS=$srcdir/../tests/texmf; export BSTINPUTS BIBINPUTS=$srcdir/tests; export BIBINPUTS -if ./bibtexu -t -d all tests/x$testname; then :; else +if $_bibtexu -t -d all tests/x$testname; then :; else echo "*** bibtexu failed, tests/x$testname.blg is:" >&2 cat tests/x$testname.blg >&2 exit 1 fi diff $srcdir/tests/$testname.bbl tests/x$testname.bbl || exit 1 + +exit 0 diff --git a/Build/source/texk/bibtex-x/tests/bibtexu-sort.test b/Build/source/texk/bibtex-x/tests/bibtexu-sort.test index 3003baee366..e73009ea113 100755 --- a/Build/source/texk/bibtex-x/tests/bibtexu-sort.test +++ b/Build/source/texk/bibtex-x/tests/bibtexu-sort.test @@ -3,6 +3,10 @@ # Copyright 2022-2023 TANAKA Takuji # You may freely use, modify and/or distribute this file. +BinDir=${BinDir:-.} +ExeExt=${ExeExt:-} +_bibtexu=$BinDir/bibtexu$ExeExt + test -d tests || mkdir tests test -d tests || exit 1 @@ -20,7 +24,7 @@ for loc in en az da fi tr; do ## test for sorting and change.case$ cp $srcdir/tests/sortu.aux tests/xsortu-$loc.aux -./bibtexu -o $loc tests/xsortu-$loc || rc=1 +$_bibtexu -o $loc tests/xsortu-$loc || rc=1 diff $srcdir/tests/sortu-$loc.bbl tests/xsortu-$loc.bbl || rc=2 done @@ -28,7 +32,7 @@ done ## test for change.case$ cp $srcdir/tests/caseu.aux tests/xcaseu.aux -max_print_line=99 ./bibtexu tests/xcaseu || rc=3 +max_print_line=99 $_bibtexu tests/xcaseu || rc=3 diff $srcdir/tests/caseu.bbl tests/xcaseu.bbl || rc=4 exit $rc diff --git a/Build/source/texk/bibtex-x/tests/bibtexu-yannis.test b/Build/source/texk/bibtex-x/tests/bibtexu-yannis.test index 8d5a6dd63de..044526c73ad 100755 --- a/Build/source/texk/bibtex-x/tests/bibtexu-yannis.test +++ b/Build/source/texk/bibtex-x/tests/bibtexu-yannis.test @@ -4,6 +4,10 @@ # You may freely use, modify and/or distribute this file. # Some actual sorting needed. +BinDir=${BinDir:-.} +ExeExt=${ExeExt:-} +_bibtexu=$BinDir/bibtexu$ExeExt + test -d tests || mkdir -p tests testname=yannis @@ -14,10 +18,12 @@ TEXMFCNF=$srcdir/../kpathsea; export TEXMFCNF BSTINPUTS=$srcdir/../web2c/tests; export BSTINPUTS BIBINPUTS=$srcdir/tests; export BIBINPUTS -if ./bibtexu -t -d all -l fr -o fr tests/x$testname; then :; else +if $_bibtexu -t -d all -l fr -o fr tests/x$testname; then :; else echo "*** bibtexu failed, tests/x$testname.blg is:" >&2 cat tests/x$testname.blg >&2 exit 1 fi diff $srcdir/tests/$testname.bbl tests/x$testname.bbl || exit 1 + +exit 0 diff --git a/Build/source/texk/bibtex-x/tests/bibtexu.test b/Build/source/texk/bibtex-x/tests/bibtexu.test index fa44b6528ea..ccb0649f395 100755 --- a/Build/source/texk/bibtex-x/tests/bibtexu.test +++ b/Build/source/texk/bibtex-x/tests/bibtexu.test @@ -5,6 +5,10 @@ # Copyright 2023 TANAKA Takuji # You may freely use, modify and/or distribute this file. +BinDir=${BinDir:-.} +ExeExt=${ExeExt:-} +_bibtexu=$BinDir/bibtexu$ExeExt + test -d tests || mkdir -p tests rc=0 @@ -17,7 +21,7 @@ cp $srcdir/../web2c/tests/exampl.aux tests/uexampl.aux || rc=1 TEXMFCNF=$srcdir/../kpathsea \ BSTINPUTS=$srcdir/../web2c/tests \ BIBINPUTS=$srcdir/../web2c/tests \ - ./bibtexu -s -d all tests/uexampl || test $? = 1 || rc=2 + $_bibtexu -s -d all tests/uexampl || test $? = 1 || rc=2 diff $srcdir/tests/exampl.bbl tests/uexampl.bbl || rc=3 @@ -30,18 +34,18 @@ export TEXMFCNF BSTINPUTS BIBINPUTS cp $srcdir/../web2c/tests/exampl.aux tests/uex_пробный.aux || rc=4 -./bibtexu -s -d io tests/uex_пробный || test $? = 1 || rc=5 +$_bibtexu -s -d io tests/uex_пробный || test $? = 1 || rc=5 diff $srcdir/tests/exampl.bbl tests/uex_пробный.bbl || rc=6 cp $srcdir/../web2c/tests/exampl.aux tests/uex_试验.aux || rc=7 -./bibtexu -s -d io tests/uex_试验 || test $? = 1 || rc=8 +$_bibtexu -s -d io tests/uex_试验 || test $? = 1 || rc=8 diff $srcdir/tests/exampl.bbl tests/uex_试验.bbl || rc=9 ## not exist, cause fatal error -./bibtexu -d io tests/uex_δίκη || test $? = 1 && rc=10 +$_bibtexu -d io tests/uex_δίκη || test $? = 1 && rc=10 exit $rc -- cgit v1.2.3