| 1 |
#! /bin/sh -vx |
| 2 |
# $Id: kpsewhich.test 68082 2023-08-27 14:18:10Z takuji $ |
| 3 |
# Copyright 2018 Karl Berry <[email protected]> |
| 4 |
# Copyright 2010-2013 Peter Breitenlohner <[email protected]> |
| 5 |
# You may freely use, modify and/or distribute this file. |
| 6 |
|
| 7 |
BinDir=${BinDir:-.} |
| 8 |
ExeExt=${ExeExt:-} |
| 9 |
_kpsewhich=$BinDir/kpsewhich$ExeExt |
| 10 |
|
| 11 |
TEXMFCNF=$srcdir |
| 12 |
export TEXMFCNF |
| 13 |
|
| 14 |
$_kpsewhich --var-value=TEXMFCNF || exit 1 # environment variable |
| 15 |
$_kpsewhich --var-value=TEXMFMAIN || exit 2 |
| 16 |
$_kpsewhich --expand-var=\$TEXMFMAIN || exit 3 |
| 17 |
|
| 18 |
# It turns out --all and no --all go through rather different code |
| 19 |
# in pathsearch.c, so try them both. |
| 20 |
|
| 21 |
if [ "$ExeExt" = ".exe" ]; then |
| 22 |
|
| 23 |
$_kpsewhich --cnf-line=TEXINPUTS=$srcdir/../tests/texmf \ |
| 24 |
--casefold-search --all Plain.TeX || exit 4 |
| 25 |
$_kpsewhich --cnf-line=TEXINPUTS=$srcdir/../tests/texmf \ |
| 26 |
--casefold-search Plain.TeX || exit 5 |
| 27 |
|
| 28 |
else |
| 29 |
|
| 30 |
TEXINPUTS=$srcdir/../tests/texmf \ |
| 31 |
$_kpsewhich --casefold-search --all Plain.TeX || exit 4 |
| 32 |
TEXINPUTS=$srcdir/../tests/texmf \ |
| 33 |
$_kpsewhich --casefold-search Plain.TeX || exit 5 |
| 34 |
|
| 35 |
fi |
| 36 |
# |
| 37 |
# These runs will succeed on case-insensitive (file)systems, so don't |
| 38 |
# run them. |
| 39 |
#TEXINPUTS=$srcdir/../tests/texmf \ |
| 40 |
# ./kpsewhich --no-casefold-search --all Plain.TeX && exit 6 |
| 41 |
#TEXINPUTS=$srcdir/../tests/texmf \ |
| 42 |
# ./kpsewhich --no-casefold-search Plain.TeX && exit 7 |
| 43 |
|
| 44 |
if [ "$ExeExt" = ".exe" ]; then |
| 45 |
|
| 46 |
$_kpsewhich --cnf-line=TEXINPUTS=$srcdir/../tests/texmf \ |
| 47 |
--all plain || exit 8 |
| 48 |
|
| 49 |
$_kpsewhich --cnf-line=AFMFONTS=$srcdir/../tests/texmf \ |
| 50 |
afmtest.afm || exit 9 |
| 51 |
|
| 52 |
$_kpsewhich --cnf-line=BSTINPUTS=$srcdir/../tests/texmf \ |
| 53 |
plain.bst || exit 10 |
| 54 |
|
| 55 |
else |
| 56 |
|
| 57 |
TEXINPUTS=$srcdir/../tests/texmf \ |
| 58 |
$_kpsewhich --all plain || exit 8 |
| 59 |
|
| 60 |
AFMFONTS=$srcdir/../tests/texmf \ |
| 61 |
$_kpsewhich afmtest.afm || exit 9 |
| 62 |
|
| 63 |
BSTINPUTS=$srcdir/../tests/texmf \ |
| 64 |
$_kpsewhich plain.bst || exit 10 |
| 65 |
|
| 66 |
fi |