automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[FYI] {maint} coverage: new test on Texinfo @include support


From: Stefano Lattarini
Subject: [FYI] {maint} coverage: new test on Texinfo @include support
Date: Wed, 19 Jun 2013 12:35:32 +0200

Backported from the Automake-NG testsuite.

* t/txinfo-include.sh: New test.
* t/list-of-tests.mk: Add it.

Signed-off-by: Stefano Lattarini <address@hidden>
---
 t/list-of-tests.mk  |   1 +
 t/txinfo-include.sh | 164 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 165 insertions(+)
 create mode 100644 t/txinfo-include.sh

diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk
index 1aebce5..9069b08 100644
--- a/t/list-of-tests.mk
+++ b/t/list-of-tests.mk
@@ -1191,6 +1191,7 @@ t/txinfo-builddir.sh \
 t/txinfo-clean.sh \
 t/txinfo-dvi-recurs.sh \
 t/txinfo-info-in-srcdir.sh \
+t/txinfo-include.sh \
 t/txinfo-makeinfo-error-no-clobber.sh \
 t/txinfo-many-output-formats.sh \
 t/txinfo-many-output-formats-vpath.sh \
diff --git a/t/txinfo-include.sh b/t/txinfo-include.sh
new file mode 100644
index 0000000..5bb8963
--- /dev/null
+++ b/t/txinfo-include.sh
@@ -0,0 +1,164 @@
+#! /bin/sh
+# Copyright (C) 2012-2013 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 <http://www.gnu.org/licenses/>.
+
+# Texinfo input files using @include directives.  Check both in-tree
+# and VPATH builds, and both top-level and subdir input.
+
+required='makeinfo tex texi2dvi'
+. test-init.sh
+
+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/desc.texi sub/hist.texi
+END
+
+cat > main.texi << 'END'
+\input texinfo
address@hidden main.info
address@hidden main
address@hidden
address@hidden Top
address@hidden GNU dummy.
address@hidden
+* one::   Chapter one
+* two::   Chapter two
+* three:: Chapter three
address@hidden menu
address@hidden ifnottex
address@hidden one.texi
address@hidden two.texi
address@hidden three.texi
address@hidden
+END
+
+cat > one.texi << 'END'
address@hidden one
address@hidden Chapter one
+Foo bar, baz.
+END
+
+cat > two.texi << 'END'
address@hidden two
address@hidden Chapter two
+Blah Blah Blah.
+END
+
+cat > three.texi << 'END'
address@hidden three
address@hidden Chapter two
+GNU's Not Unix.
+END
+
+mkdir sub
+
+cat > sub/more.texi << 'END'
+\input texinfo
address@hidden more.info
address@hidden main
address@hidden
address@hidden Top
address@hidden GNU more.
address@hidden
+* desc:: Description of this program
+* hist:: History of this program
address@hidden menu
address@hidden ifnottex
address@hidden desc.texi
address@hidden hist.texi
address@hidden
+END
+
+cat > sub/desc.texi << 'END'
address@hidden desc
address@hidden Description of this program
+It does something, really.
+END
+
+cat > sub/hist.texi << 'END'
address@hidden hist
address@hidden 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
+
+:
-- 
1.8.3.1.437.g0dbd812




reply via email to

[Prev in Thread] Current Thread [Next in Thread]