| 1 |
#! /bin/sh -vx |
| 2 |
# |
| 3 |
# Copyright 2022 TANAKA Takuji <[email protected]> |
| 4 |
# You may freely use, modify and/or distribute this file. |
| 5 |
|
| 6 |
BinDir=${BinDir:-.} |
| 7 |
ExeExt=${ExeExt:-} |
| 8 |
_bibtex8=$BinDir/bibtex8$ExeExt |
| 9 |
|
| 10 |
test -d tests || mkdir -p tests |
| 11 |
|
| 12 |
rc=0 |
| 13 |
|
| 14 |
TEXMFCNF=$srcdir/../kpathsea |
| 15 |
BSTINPUTS=$srcdir/{tests,csf} |
| 16 |
BIBINPUTS=$srcdir/tests |
| 17 |
export TEXMFCNF BSTINPUTS BIBINPUTS |
| 18 |
|
| 19 |
|
| 20 |
## test for add.period$ |
| 21 |
cp $srcdir/tests/perioda.aux tests/xperioda.aux |
| 22 |
$_bibtex8 tests/xperioda || rc=3 |
| 23 |
diff $srcdir/tests/perioda.bbl tests/xperioda.bbl || rc=4 |
| 24 |
|
| 25 |
## test for substring$ |
| 26 |
cp $srcdir/tests/substra.aux tests/xsubstra.aux |
| 27 |
$_bibtex8 tests/xsubstra || rc=5 |
| 28 |
diff $srcdir/tests/substra.bbl tests/xsubstra.bbl || rc=6 |
| 29 |
|
| 30 |
## test for text.length$, text.prefix$ |
| 31 |
cp $srcdir/tests/txtprfxa.aux tests/xtxtprfxa.aux |
| 32 |
$_bibtex8 tests/xtxtprfxa || rc=7 |
| 33 |
diff $srcdir/tests/txtprfxa.bbl tests/xtxtprfxa.bbl || rc=8 |
| 34 |
|
| 35 |
## test for width$ |
| 36 |
cp $srcdir/tests/widtha.aux tests/xwidtha.aux |
| 37 |
$_bibtex8 --csfile sort1.csf tests/xwidtha || rc=9 |
| 38 |
diff $srcdir/tests/widtha.bbl tests/xwidtha.bbl || rc=10 |
| 39 |
|
| 40 |
## test for chr.to.int$, int.to.str$, int.to.chr$ |
| 41 |
cp $srcdir/tests/chara.aux tests/xchara.aux |
| 42 |
$_bibtex8 tests/xchara || rc=11 |
| 43 |
diff $srcdir/tests/chara.bbl tests/xchara.bbl || rc=12 |
| 44 |
|
| 45 |
## test for num.names$, format.name$ |
| 46 |
cp $srcdir/tests/namea.aux tests/xnamea.aux |
| 47 |
max_print_line=119 $_bibtex8 tests/xnamea || rc=13 |
| 48 |
diff $srcdir/tests/namea.bbl tests/xnamea.bbl || rc=14 |
| 49 |
|
| 50 |
|
| 51 |
exit $rc |
| 52 |
|