| 1 |
#! /bin/sh -vx |
| 2 |
# $Id: upmendex.test 77343 2026-01-12 02:21:43Z takuji $ |
| 3 |
# Copyright 2021-2026 TANAKA Takuji <[email protected]> |
| 4 |
# Copyright 2017-2022 Karl Berry <[email protected]> |
| 5 |
# Copyright 2013 Peter Breitenlohner <[email protected]> |
| 6 |
# You may freely use, modify and/or distribute this file. |
| 7 |
|
| 8 |
BinDir=${BinDir:-.} |
| 9 |
ExeExt=${ExeExt:-} |
| 10 |
_upmendex=$BinDir/upmendex$ExeExt |
| 11 |
|
| 12 |
TEXMFCNF=$srcdir/../kpathsea |
| 13 |
export TEXMFCNF |
| 14 |
|
| 15 |
rm -f sample.* foo.* uni.* tort*.* |
| 16 |
rc=0 |
| 17 |
|
| 18 |
$_upmendex --help || rc=100 |
| 19 |
$_upmendex --version || rc=101 |
| 20 |
|
| 21 |
$_upmendex $srcdir/tests/sample.idx -o sample.ind1 -t sample.ilg1 \ |
| 22 |
&& diff $srcdir/tests/sample.ind sample.ind1 || rc=51 |
| 23 |
|
| 24 |
$_upmendex $srcdir/tests/foo.idx -o foo.ind1 -t foo.ilg1 \ |
| 25 |
&& diff $srcdir/tests/foo.ind foo.ind1 || rc=1 |
| 26 |
|
| 27 |
cat $srcdir/tests/foo.idx | $_upmendex >foo.ind2 2>foo.ilg2 \ |
| 28 |
&& diff $srcdir/tests/foo.ind foo.ind2 || rc=2 |
| 29 |
|
| 30 |
$_upmendex -d $srcdir/tests/uni.dict -s $srcdir/tests/uni.ist \ |
| 31 |
$srcdir/tests/uni.idx -o uni.ind1 -t uni.ilg1 \ |
| 32 |
&& diff $srcdir/tests/uni.ind uni.ind1 || rc=3 |
| 33 |
|
| 34 |
cat $srcdir/tests/uni.idx | \ |
| 35 |
$_upmendex -d $srcdir/tests/uni.dict -s $srcdir/tests/uni.ist \ |
| 36 |
>uni.ind2 2>uni.ilg2 \ |
| 37 |
&& diff $srcdir/tests/uni.ind uni.ind2 || rc=4 |
| 38 |
|
| 39 |
$_upmendex -d $srcdir/tests/uni.dict -s $srcdir/tests/uni1.ist -s $srcdir/tests/uni2.ist \ |
| 40 |
$srcdir/tests/uni.idx -o uni.ind3 -t uni.ilg3 \ |
| 41 |
&& diff $srcdir/tests/uni.ind uni.ind3 || rc=5 |
| 42 |
|
| 43 |
INDEXSTYLE=$srcdir/tests |
| 44 |
export INDEXSTYLE |
| 45 |
|
| 46 |
$_upmendex -d $srcdir/tests/uni.dict -s uni.ist \ |
| 47 |
$srcdir/tests/uni.idx -o uni.ind4 -t uni.ilg4 \ |
| 48 |
&& diff $srcdir/tests/uni.ind uni.ind4 || rc=6 |
| 49 |
|
| 50 |
INDEXDICTIONARY=$srcdir/tests |
| 51 |
export INDEXDICTIONARY |
| 52 |
|
| 53 |
$_upmendex -d uni.dict -s uni.ist \ |
| 54 |
$srcdir/tests/uni.idx -o uni.ind5 -t uni.ilg5 \ |
| 55 |
&& diff $srcdir/tests/uni.ind uni.ind5 || rc=7 |
| 56 |
|
| 57 |
$_upmendex $srcdir/tests/tort.idx -o tort.ind1 -t tort.ilg1 \ |
| 58 |
&& rc=20 |
| 59 |
#$_upmendex $srcdir/tests/tort.idx -o tort.ind1 -t tort.ilg1 \ |
| 60 |
# && diff $srcdir/tests/ok-tort.ind tort.ind1 || : |
| 61 |
|
| 62 |
$_upmendex $srcdir/tests/tortW.idx -o tortW.ind1 -t tortW.ilg1 \ |
| 63 |
&& diff $srcdir/tests/ok-tort.ind tortW.ind1 || : |
| 64 |
|
| 65 |
$_upmendex $srcdir/tests/tort.idx -s $srcdir/tests/head1.ist -o tort2.ind1 -t tort2.ilg1 \ |
| 66 |
&& diff $srcdir/tests/ok-tort2.ind tort2.ind1 || : |
| 67 |
|
| 68 |
$_upmendex $srcdir/tests/tortW.idx -s $srcdir/tests/head1.ist -o tortW2.ind1 -t tortW2.ilg1 \ |
| 69 |
&& diff $srcdir/tests/ok-tort2.ind tortW2.ind1 || : |
| 70 |
|
| 71 |
|
| 72 |
exit $rc |