2 # Id: txitextest,v 1.5 2004/04/11 17:56:47 karl Exp
3 # Test texinfo.tex changes by running various manuals through with an
4 # old version, saving the .ps result from dvips, doing the same with a
5 # new version, and comparing. Idea from Stepan Kasal.
7 # Another option is to run the manuals all the way through using
8 # texi2dvi, which tests in another way.
14 default_manuals
="$tdoc/texinfo.txi $tdoc/info.texi $tdoc/info-stnd.texi"
16 olddir
=$HOME/gnu
/src
/gnulib
/config
18 tempdir
=/u
/texinfo
/@
tests
/testdir
22 while test $# -gt 0; do
25 --o*) shift; olddir
="$1";;
26 --n*) shift; newdir
="$1";;
27 --t*) shift; tempdir
="$1";;
28 -*) echo "$0: unknown option \`$1'." >&2; exit 1;;
29 *) manuals
="$manuals $1";;
34 test -z "$manuals" && manuals
=$default_manuals
42 TEXINPUTS
=.
:$mandir: tex
$manual \
43 ||
{ echo "tex $manual failed." >&2; exit 1; }
46 for manual
in $manuals; do
47 mandir
=`dirname $manual`
48 test $mandir = .
&& mandir
=$initial_dir
49 manual_base
=`basename "$manual" | sed 's/\.[^.]*$//'`
51 rm -f $manual_base.
* texinfo.tex
52 ln -s $newdir/texinfo.tex texinfo.tex
55 # instead of comparing, do full test of just the new texinfo.tex.
56 echo "$0: testing $manual_base... (tex)"
57 texi2dvi
$manual ||
{ echo "texi2dvi $manual failed." >&2; exit 1; }
58 echo "$0: testing $manual_base... (pdf)"
59 texi2dvi
--pdf $manual \
60 ||
{ echo "texi2dvi --pdf $manual failed." >&2; exit 1; }
63 echo "$0: testing $manual_base... (new)"
65 dvips
$manual_base -o ||
exit 1
66 mv $manual_base.ps new.
$manual_base.ps
68 echo "$0: testing $manual_base... (old)"
69 rm -f $manual_base.
* texinfo.tex
70 ln -s $olddir/texinfo.tex texinfo.tex
72 dvips
$manual_base -o ||
exit 1
73 mv $manual_base.ps old.
$manual_base.ps
75 diff -U0 old.
$manual_base.ps new.
$manual_base.ps