From: Stefano Lattarini Date: Sat, 16 Jun 2012 18:31:48 +0000 (+0200) Subject: [ng] coverage: texinfo input files using @include directives X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac3768c8f1b8ad983d90286b911995ccf55a96fa;p=thirdparty%2Fautomake.git [ng] coverage: texinfo input files using @include directives Both in-tree and VPATH builds, and both top-level and subdir input. * t/txinfo-include.sh: New test. Signed-off-by: Stefano Lattarini --- diff --git a/t/txinfo-include.sh b/t/txinfo-include.sh new file mode 100755 index 000000000..dd4d6335a --- /dev/null +++ b/t/txinfo-include.sh @@ -0,0 +1,164 @@ +#! /bin/sh +# Copyright (C) 2012 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Texinfo input files using @include directives. Check both in-tree +# and VPATH builds, and both top-level and subdir input. + +required='makeinfo tex texi2dvi' +. ./defs || Exit 1 + +echo AC_OUTPUT >> configure.ac + +cat > Makefile.am << 'END' +info_TEXINFOS = main.texi sub/more.texi +main_TEXINFOS = one.texi two.texi three.texi +sub_more_TEXINFOS = sub/one.texi sub/two.texi +END + +cat > main.texi << 'END' +\input texinfo +@setfilename main.info +@settitle main +@ifnottex +@node Top +@top GNU dummy. +@menu +* one:: Chapter one +* two:: Chapter two +* three:: Chapter three +@end menu +@end ifnottex +@include one.texi +@include two.texi +@include three.texi +@bye +END + +cat > one.texi << 'END' +@node one +@chapter Chapter one +Foo bar, baz. +END + +cat > two.texi << 'END' +@node two +@chapter Chapter two +Blah Blah Blah. +END + +cat > three.texi << 'END' +@node three +@chapter Chapter two +GNU's Not Unix. +END + +mkdir sub + +cat > sub/more.texi << 'END' +\input texinfo +@setfilename more.info +@settitle main +@ifnottex +@node Top +@top GNU more. +@menu +* desc:: Description of this program +* hist:: History of this program +@end menu +@end ifnottex +@include one.texi +@include two.texi +@bye +END + +cat > sub/one.texi << 'END' +@node desc +@chapter Description of this program +It does something, really. +END + +cat > sub/two.texi << 'END' +@node hist +@chapter History of this program +It was written somehow. +END + +cat > exp << 'END' +./main.info +./sub/more.info +END + +check_info_contents () +{ + srcdir=${1-.} + $FGREP "Foo bar, baz." $srcdir/main.info + $FGREP "Blah Blah Blah." $srcdir/main.info + $FGREP "GNU's Not Unix." $srcdir/main.info + $FGREP 'It does something, really.' $srcdir/sub/more.info + $FGREP 'It was written somehow.' $srcdir/sub/more.info +} + +get_info_names () +{ + find ${1-.} -type f -name '*.info' | LC_ALL=C sort > got +} + +check_expected () +{ + cat exp + cat got + diff exp got +} + +$ACLOCAL +$AUTOMAKE --add-missing +$AUTOCONF + +./configure + +$MAKE info +get_info_names +check_expected + +check_info_contents + +$MAKE dvi +test -f main.dvi +test -f sub/more.dvi + +$MAKE maintainer-clean +test ! -f main.dvi +test ! -f sub/more.dvi +test ! -f main.info +test ! -f sub/more.info + +mkdir build +cd build +../configure +$MAKE all dvi + +get_info_names .. +sed 's|^\./|../|' ../exp > exp +check_expected + +test -f main.dvi +test -f sub/more.dvi + +check_info_contents .. + +$MAKE distcheck + +: