summaryrefslogtreecommitdiff
path: root/Build/source/texk/detex/detex.test
blob: ae1ce06dae89801a33f9bc15fb8072ebce8aa5a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#! /bin/sh -vx
# $Id$
# Copyright 2017 Karl Berry <tex-live@tug.org>
# Copyright 2009 Peter Breitenlohner <tex-live@tug.org>
# You may freely use, modify and/or distribute this file.

BinDir=${BinDir:-.}
ExeExt=${ExeExt:-}
_detex=$BinDir/detex$ExeExt

# pre-generated test results in the repository are stored in LF
# but the output might be written in CRLF on some platform.
# if 'diff --strip-trailing-cr' is available, exploit it.
# (useful for tests on win32 binaries run on MSYS shell)
DIFF="diff"
$DIFF --strip-trailing-cr $0 $0 \
  && DIFF="diff --strip-trailing-cr" || echo

echo '#' >texmf.cnf

rc=0

$_detex -v

$_detex $srcdir/test.tex >test.out \
	&& $DIFF test.out $srcdir/test.lout \
	|| rc=1

$_detex -l $srcdir/test.tex >test.out \
	&& $DIFF test.out $srcdir/test.lout \
	|| rc=2

$_detex -t $srcdir/test.tex >test.out \
	&& $DIFF test.out $srcdir/test.tout \
	|| rc=3

exit $rc