| 1 |
#! /bin/sh -vx |
| 2 |
# $Id: detex.test 68156 2023-09-03 11:26:27Z takuji $ |
| 3 |
# Copyright 2017 Karl Berry <[email protected]> |
| 4 |
# Copyright 2009 Peter Breitenlohner <[email protected]> |
| 5 |
# You may freely use, modify and/or distribute this file. |
| 6 |
|
| 7 |
BinDir=${BinDir:-.} |
| 8 |
ExeExt=${ExeExt:-} |
| 9 |
_detex=$BinDir/detex$ExeExt |
| 10 |
|
| 11 |
# pre-generated test results in the repository are stored in LF |
| 12 |
# but the output might be written in CRLF on some platform. |
| 13 |
# if 'diff --strip-trailing-cr' is available, exploit it. |
| 14 |
# (useful for tests on win32 binaries run on MSYS shell) |
| 15 |
DIFF="diff" |
| 16 |
$DIFF --strip-trailing-cr $0 $0 \ |
| 17 |
&& DIFF="diff --strip-trailing-cr" || echo |
| 18 |
|
| 19 |
echo '#' >texmf.cnf |
| 20 |
|
| 21 |
rc=0 |
| 22 |
|
| 23 |
$_detex -v |
| 24 |
|
| 25 |
$_detex $srcdir/test.tex >test.out \ |
| 26 |
&& $DIFF test.out $srcdir/test.lout \ |
| 27 |
|| rc=1 |
| 28 |
|
| 29 |
$_detex -l $srcdir/test.tex >test.out \ |
| 30 |
&& $DIFF test.out $srcdir/test.lout \ |
| 31 |
|| rc=2 |
| 32 |
|
| 33 |
$_detex -t $srcdir/test.tex >test.out \ |
| 34 |
&& $DIFF test.out $srcdir/test.tout \ |
| 35 |
|| rc=3 |
| 36 |
|
| 37 |
exit $rc |