| 1 |
#! /bin/sh -vx |
| 2 |
# Copyright 2017-2018 Karl Berry <[email protected]> |
| 3 |
# Copyright 2015 Peter Breitenlohner <[email protected]> |
| 4 |
# You may freely use, modify and/or distribute this file. |
| 5 |
|
| 6 |
BinDir=${BinDir:-.} |
| 7 |
ExeExt=${ExeExt:-} |
| 8 |
_msxlint=$BinDir/msxlint$ExeExt |
| 9 |
|
| 10 |
# pre-generated test results in the repository are stored in LF |
| 11 |
# but the output might be written in CRLF on some platform. |
| 12 |
# if 'diff --strip-trailing-cr' is available, exploit it. |
| 13 |
# (useful for tests on win32 binaries run on MSYS shell) |
| 14 |
DIFF="diff" |
| 15 |
$DIFF --strip-trailing-cr $0 $0 \ |
| 16 |
&& DIFF="diff --strip-trailing-cr" || echo |
| 17 |
|
| 18 |
LC_ALL=C; export LC_ALL; LANGUAGE=C; export LANGUAGE |
| 19 |
|
| 20 |
echo && echo "*** msxlint --help" |
| 21 |
$_msxlint --help || exit 1 |
| 22 |
|
| 23 |
echo && echo "*** msxlint --version" |
| 24 |
$_msxlint --version || exit 2 |
| 25 |
|
| 26 |
: ${testsrc:=$srcdir/tests} |
| 27 |
|
| 28 |
echo && echo "*** msxlint -d tests/badtest" |
| 29 |
$_msxlint -d $testsrc/badtest && exit 3 |
| 30 |
|
| 31 |
echo && echo "*** msxlint tests/linttest >linttest.out1" |
| 32 |
$_msxlint $testsrc/linttest | sed '/^This/,/^Processing/d' >linttest.out1 || exit 4 |
| 33 |
|
| 34 |
echo && echo "*** diff tests/linttest.out linttest.out1" |
| 35 |
$DIFF $testsrc/linttest.out linttest.out1 || exit 5 |
| 36 |
|
| 37 |
echo && echo "*** cat tests/linttest.tex | msxlint >linttest.out2" |
| 38 |
cat $testsrc/linttest.tex | $_msxlint | sed '/^This/,/^Processing/d' >linttest.out2 || exit 6 |
| 39 |
|
| 40 |
echo && echo "*** diff tests/linttest.out linttest.out2" |
| 41 |
$DIFF $testsrc/linttest.out linttest.out2 || exit 7 |
| 42 |
|