summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2011-01-11 01:59:29 +0100
committerStefano Lattarini <stefano.lattarini@gmail.com>2011-01-11 01:59:29 +0100
commita115c7c75580f71dd6c123bb1cdaa07f742fd3a3 (patch)
tree9ca20f14898ee9872f79dd135d25e9bee15a9b24
parentbb528a71d97ba1b529c314e391253c3b6e2be078 (diff)
parent6318add07d8f2f8507edcfd85461afea77f68a90 (diff)
downloadautomake-a115c7c75580f71dd6c123bb1cdaa07f742fd3a3.tar.gz
Merge branch 'tests-texinfo' into maint
-rw-r--r--ChangeLog55
-rw-r--r--tests/Makefile.am3
-rw-r--r--tests/Makefile.in3
-rwxr-xr-xtests/comments-in-var-defn.test58
-rwxr-xr-xtests/instdir-texi.test9
-rwxr-xr-xtests/txinfo.test31
-rwxr-xr-xtests/txinfo16.test11
-rwxr-xr-xtests/txinfo18.test16
-rwxr-xr-xtests/txinfo2.test22
-rwxr-xr-xtests/txinfo22.test20
-rwxr-xr-xtests/txinfo23.test14
-rwxr-xr-xtests/txinfo24.test10
-rwxr-xr-xtests/txinfo25.test15
-rwxr-xr-xtests/txinfo29.test17
-rwxr-xr-xtests/txinfo3.test14
-rwxr-xr-xtests/txinfo4.test7
-rwxr-xr-xtests/txinfo5.test10
-rwxr-xr-xtests/txinfo6.test13
-rwxr-xr-xtests/txinfo7.test12
-rwxr-xr-xtests/txinfo8.test42
-rwxr-xr-xtests/txinfo9.test22
-rwxr-xr-xtests/vtexi.test34
-rwxr-xr-xtests/vtexi2.test6
-rwxr-xr-xtests/vtexi3.test124
-rwxr-xr-xtests/vtexi4.test118
25 files changed, 569 insertions, 117 deletions
diff --git a/ChangeLog b/ChangeLog
index b59819f8f..111590776 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,58 @@
+2011-01-11 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ Improve, extend and tweak tests on Texinfo support.
+ * tests/instdir-texi.test: Add a call to `ls -l' after that to
+ `make', for debugging. When looking for required tools, do not
+ redirect the output of "$tool --help" to /dev/null, and do not
+ uselessly run it in a subshell.
+ * tests/txinfo.test: Rewritten to run autoconf, ./configure and
+ make. All checks moved into Makefile.am.
+ * tests/txinfo8.test: Likewise, and modernize the generated
+ configure.in.
+ * tests/txinfo2.test: Moved checks into Makefile.am, and other
+ minor improvements.
+ * tests/txinfo5.test: Enable `errexit' shell flag, and related
+ changes. Add trailing `:' command.
+ * tests/txinfo6.test: Likewise, and make grepping of generated
+ Makefile.in stricter.
+ * tests/txinfo7.test: Enable `errexit' shell flag, and related
+ changes. Add trailing `:' command. Do not add unnecessary stuff
+ to Makefile.am.
+ * tests/txinfo9.test: Verify that more targets which are expected
+ to be generated only once really are. Make grepping less strict,
+ to avoid exposing too much internal details. More minor changes.
+ * tests/txinfo16.test: Add trailing `:'. Prefer cat over echo
+ for appending to configure.in. Updated/fixed heading comments.
+ * tests/txinfo23.test: Likewise, and extended a little by making
+ it check that no info file is created in the $(srcdir).
+ * tests/txinfo24.test: Likewise.
+ * tests/txinfo25.test: Likewise.
+ * tests/txinfo18.test: Add trailing `:'. Prefer cat over echo
+ for appending to configure.in. Also, check that index files are
+ cleaned also by "make clean", not only by "make distclean".
+ * tests/txinfo22.test: Prefer `$me' over hard-coded test name,
+ and added trailing `:' command. This testcase also used to check
+ that automake ignores in-line comments when using variables, but
+ preserves them in the output; these checks (added in commit
+ "Release-1-7f-4-g9177ef8") do not really pertain to this test,
+ so they have been moved ...
+ * tests/comments-in-var-defn.test: ... into this new test.
+ * tests/txinfo4.test: Escape literal dots in grep regexps. Add
+ trailing `:' command.
+ * tests/txinfo29.test: Likewise. Relax grepping of generated
+ Makefile.in w.r.t. whitespaces. Prefer `cat' over `echo' to
+ append to configure.in.
+ * tests/txinfo3.test: Likewise.
+ * tests/vtexi.test: Improve grepping of Makefile.in (sometimes
+ make it stricter, sometimes laxer). Move `set -e' setting just
+ after the inclusion of ./defs. De-uglify a sed command. Other
+ minor cosmetic improvements.
+ * tests/vtexi2.test: Make grepping of Makefile.in stricter. Add
+ trailing `:' command.
+ * tests/vtexi3.test: New test on version.texi support.
+ * tests/vtexi4.test: Likewise.
+ * tests/Makefile.am (TESTS): Updated.
+
2011-01-09 Stefano Lattarini <stefano.lattarini@gmail.com>
cosmetics: remove trailing whitespaces
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 8842be389..ceb503b89 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -158,6 +158,7 @@ comment8.test \
comment9.test \
commen10.test \
commen11.test \
+comments-in-var-defn.test \
compile.test \
compile2.test \
compile_f90_c_cxx.test \
@@ -786,6 +787,8 @@ version8.test \
vpath.test \
vtexi.test \
vtexi2.test \
+vtexi3.test \
+vtexi4.test \
warnopts.test \
werror.test \
werror2.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 3bc441555..7ecfcaabd 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -425,6 +425,7 @@ comment8.test \
comment9.test \
commen10.test \
commen11.test \
+comments-in-var-defn.test \
compile.test \
compile2.test \
compile_f90_c_cxx.test \
@@ -1053,6 +1054,8 @@ version8.test \
vpath.test \
vtexi.test \
vtexi2.test \
+vtexi3.test \
+vtexi4.test \
warnopts.test \
werror.test \
werror2.test \
diff --git a/tests/comments-in-var-defn.test b/tests/comments-in-var-defn.test
new file mode 100755
index 000000000..b00ee6b6f
--- /dev/null
+++ b/tests/comments-in-var-defn.test
@@ -0,0 +1,58 @@
+#! /bin/sh
+# Copyright (C) 2011 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/>.
+
+# Make sure Automake ignores in-line comments when using variables,
+# but preserve them in the output.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in <<'END'
+AC_OUTPUT
+END
+
+# Use a slash in the comment, because automake takes the dirname
+# of TEXINFO_TEX to compute $(am__TEXINFO_TEX_DIR).
+cat > Makefile.am << 'END'
+TEXINFO_TEX = tex/texinfo.tex # some comment w/ a slash
+info_TEXINFOS = main.texi
+.PHONY: test
+test:
+ test tex/texinfo.tex = $(TEXINFO_TEX)
+ test -d '$(am__TEXINFO_TEX_DIR)'
+ case '$(am__TEXINFO_TEX_DIR)' in tex|./tex) :;; *) exit 1;; esac
+END
+
+cat > main.texi << 'END'
+\input texinfo
+@setfilename main.info
+END
+
+mkdir tex
+: > tex/texinfo.tex
+
+$ACLOCAL
+$AUTOMAKE
+
+grep TEX Makefile.in # for debugging
+grep '^TEXINFO_TEX *= *tex/texinfo\.tex *# some comment w/ a slash *$' Makefile.in
+
+$AUTOCONF
+./configure
+$MAKE test
+
+:
diff --git a/tests/instdir-texi.test b/tests/instdir-texi.test
index 50617c8b1..8210535b9 100755
--- a/tests/instdir-texi.test
+++ b/tests/instdir-texi.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2009 Free Software Foundation, Inc.
+# Copyright (C) 2009, 2011 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
@@ -20,9 +20,8 @@
required='makeinfo-html tex texi2dvi'
. ./defs || Exit 1
-(dvips --help 2>/dev/null >/dev/null) || Exit 77
-(pdfetex --help 2>/dev/null >/dev/null) ||
- (pdftex --help 2>/dev/null >/dev/null) || Exit 77
+dvips --help || Exit 77
+pdfetex --help || pdftex --help || Exit 77
set -e
@@ -54,6 +53,7 @@ mkdir build
cd build
../configure --prefix="$instdir"
$MAKE all dvi ps pdf html
+ls -l
infodir= htmldir= dvidir= psdir= pdfdir=
export infodir htmldir dvidir psdir pdfdir
@@ -67,4 +67,5 @@ $MAKE -e uninstall > stdout || { cat stdout; Exit 1; }
cat stdout
grep 'rm -f' stdout && Exit 1
$MAKE -e uninstall DESTDIR="$destdir"
+
:
diff --git a/tests/txinfo.test b/tests/txinfo.test
index 3f1c53384..2e9448674 100755
--- a/tests/txinfo.test
+++ b/tests/txinfo.test
@@ -1,6 +1,6 @@
#! /bin/sh
-# Copyright (C) 1996, 1997, 1998, 2000, 2001, 2002, 2003
-# Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2011 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
@@ -15,22 +15,35 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Test to ensure texinfo.tex included in distribution. Bug report by
+# Test to ensure texinfo.tex is included in distribution. Bug report by
# Jim Meyering.
. ./defs || Exit 1
+set -e
+
+cat >> configure.in <<'END'
+AC_OUTPUT
+END
+
cat > Makefile.am << 'END'
info_TEXINFOS = textutils.texi
-magic:
- @echo $(DISTFILES)
+.PHONY: test1 test2
+test1:
+ @echo DISTFILES = $(DISTFILES)
+ echo ' ' $(DISTFILES) ' ' | grep '[ /]texinfo\.tex '
+test2: distdir
+ ls -l $(distdir)
+ test -f $(distdir)/texinfo.tex
END
echo '@setfilename textutils.info' > textutils.texi
: > texinfo.tex
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+./configure
+$MAKE test1 test2
-$FGREP -v @SET_MAKE@ Makefile.in > Makefile.sed
-$MAKE -s -f Makefile.sed SHELL=$SHELL magic | grep 'texinfo\.tex'
+:
diff --git a/tests/txinfo16.test b/tests/txinfo16.test
index 66ed68645..4c14abacf 100755
--- a/tests/txinfo16.test
+++ b/tests/txinfo16.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2002, 2003, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2008, 2011 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
@@ -14,14 +14,17 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Check that info files are not built in $(srcdir).
+# Check that info files are normally built in $(srcdir),
+# not in $(builddir).
required='makeinfo tex texi2dvi'
. ./defs || Exit 1
set -e
-echo AC_OUTPUT >> configure.in
+cat >> configure.in << 'END'
+AC_OUTPUT
+END
cat > Makefile.am << 'END'
info_TEXINFOS = main.texi
@@ -86,3 +89,5 @@ $MAKE dvi
test -f main.dvi
$MAKE distcheck
+
+:
diff --git a/tests/txinfo18.test b/tests/txinfo18.test
index 4df52573c..8dc896163 100755
--- a/tests/txinfo18.test
+++ b/tests/txinfo18.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2002, 2008, 2009 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2008, 2009, 2011 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
@@ -23,7 +23,9 @@ required='makeinfo tex texi2dvi'
set -e
-echo AC_OUTPUT >> configure.in
+cat >> configure.in << 'END'
+AC_OUTPUT
+END
cat > Makefile.am << 'END'
info_TEXINFOS = main.texi
@@ -62,4 +64,14 @@ $AUTOMAKE --add-missing
$AUTOCONF
./configure
+
+$MAKE dvi
+ls -l # for debugging
+test -f main.sa # sanity check
+$MAKE clean
+ls -l # for debugging
+test x"`echo main.*`" = x"main.texi"
+
TAR_OPTIONS= $MAKE distcheck
+
+:
diff --git a/tests/txinfo2.test b/tests/txinfo2.test
index 2324f57f0..f51d0b631 100755
--- a/tests/txinfo2.test
+++ b/tests/txinfo2.test
@@ -1,5 +1,6 @@
#! /bin/sh
-# Copyright (C) 1996, 1997, 2001, 2002, 2003 Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 2001, 2002, 2003, 2011 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
@@ -21,24 +22,27 @@
set -e
-echo AC_OUTPUT >> configure.in
+cat >> configure.in << 'END'
+AC_OUTPUT
+END
cat > Makefile.am << 'END'
info_TEXINFOS = textutils.texi
-magic:
- @echo $(DISTFILES)
+.PHONY: test
+test:
+ @echo DISTFILES = $(DISTFILES)
+ case '$(DISTFILES)' in *'~'*) exit 1;; *) exit 0;; esac
END
: > texinfo.tex
echo '@setfilename textutils.info' > textutils.texi
: > textutils.info~
-
$ACLOCAL
$AUTOCONF
$AUTOMAKE
+
./configure
-$MAKE magic >stdout
-cat stdout
-grep '~' stdout && Exit 1
-Exit 0
+$MAKE test
+
+:
diff --git a/tests/txinfo22.test b/tests/txinfo22.test
index 3c2265da0..c2f23e176 100755
--- a/tests/txinfo22.test
+++ b/tests/txinfo22.test
@@ -1,5 +1,6 @@
#! /bin/sh
-# Copyright (C) 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004, 2007, 2008, 2011 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
@@ -15,32 +16,27 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Make sure the user can override TEXINFO_TEX.
-# Report from Tom Tromey.
-# Also make sure Automake ignores in-line comments when using variables,
-# but preserve them in the output.
# Also make sure TEXINFO_TEX is not distributed.
+# Report from Tom Tromey.
required='makeinfo tex texi2dvi'
. ./defs || Exit 1
set -e
-cat > configure.in << 'END'
-AC_INIT([txinfo22], [1.0])
+cat > configure.in << END
+AC_INIT([$me], [1.0])
AC_CONFIG_AUX_DIR([aux1])
AM_INIT_AUTOMAKE
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
END
-# Use a slash in the comment, because automake takes the dirname
-# of TEXINFO_TEX to compute $(am__TEXINFO_TEX_DIR)...
cat > Makefile.am << 'END'
-TEXINFO_TEX = $(srcdir)/tex/texinfo.tex # some comment w/ a slash
+TEXINFO_TEX = $(srcdir)/tex/texinfo.tex
info_TEXINFOS = main.texi
sure_it_exists:
test -f $(TEXINFO_TEX)
- test -d "$(am__TEXINFO_TEX_DIR)"
sure_it_is_not_distributed: distdir
test ! -f $(distdir)/tex/texinfo.tex
END
@@ -67,7 +63,9 @@ test ! -f aux1/texinfo.tex
test -f tex/texinfo.tex
./configure
+
$MAKE sure_it_exists
$MAKE distcheck
-grep 'TEXINFO_TEX = .* # some comment w/ a slash' Makefile
$MAKE sure_it_is_not_distributed
+
+:
diff --git a/tests/txinfo23.test b/tests/txinfo23.test
index 903e681ac..660487d8c 100755
--- a/tests/txinfo23.test
+++ b/tests/txinfo23.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2002, 2003, 2007 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2007, 2011 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
@@ -14,15 +14,19 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Check for subdir Texinfo in $(srcdir).
+# Check that info files are built in builddir when needed.
+# Test with subdir Texinfo.
# (Similar to txinfo13.test, plus DISTCLEANFILES.)
+# (See also txinfo24.test and txinfo25.test)
required='makeinfo tex texi2dvi-o'
. ./defs || Exit 1
set -e
-echo AC_OUTPUT >> configure.in
+cat >> configure.in << 'END'
+AC_OUTPUT
+END
cat > Makefile.am << 'END'
DISTCLEANFILES = subdir/*.info*
@@ -50,7 +54,6 @@ cat > subdir/inc.texi << 'END'
I'm included.
END
-
$ACLOCAL
$AUTOMAKE --add-missing
$AUTOCONF
@@ -60,3 +63,6 @@ cd build
../configure
$MAKE distcheck
test -f subdir/main.info
+test ! -f ../subdir/main.info
+
+:
diff --git a/tests/txinfo24.test b/tests/txinfo24.test
index 4c0bc8200..fc9f9d1e0 100755
--- a/tests/txinfo24.test
+++ b/tests/txinfo24.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2011 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
@@ -16,13 +16,16 @@
# Check that info files are built in builddir when needed.
# (Similar to txinfo16.test, plus CLEANFILES.)
+# (See also txinfo23.test and txinfo25.test)
required='makeinfo tex texi2dvi-o'
. ./defs || Exit 1
set -e
-echo AC_OUTPUT >> configure.in
+cat >> configure.in << 'END'
+AC_OUTPUT
+END
cat > Makefile.am << 'END'
CLEANFILES = main.info
@@ -47,6 +50,7 @@ mkdir build
cd build
../configure
$MAKE
+test ! -f ../main.info
test -f main.info
cd ..
@@ -77,3 +81,5 @@ $MAKE dvi
test -f main.dvi
$MAKE distcheck
+
+:
diff --git a/tests/txinfo25.test b/tests/txinfo25.test
index 85007f936..f80b035da 100755
--- a/tests/txinfo25.test
+++ b/tests/txinfo25.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2003 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2011 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
@@ -14,15 +14,20 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Similar to texinfo24.test, but with two info files, only one of
-# which being cleaned.
+# Check that info files are built in builddir and in srcdir can safely
+# co-exist. This setup is obtained by having two info files, only one
+# of which being cleaned.
+# (Similar to txinfo16.test, plus CLEANFILES.)
+# (See also txinfo23.test and txinfo24.test)
required='makeinfo tex texi2dvi-o'
. ./defs || Exit 1
set -e
-echo AC_OUTPUT >> configure.in
+cat >> configure.in << 'END'
+AC_OUTPUT
+END
cat > Makefile.am << 'END'
CLEANFILES = [a-m]*.info
@@ -104,3 +109,5 @@ test -f main.dvi
test -f other.dvi
$MAKE distcheck
+
+:
diff --git a/tests/txinfo29.test b/tests/txinfo29.test
index 1d4aeff38..42dd3abdf 100755
--- a/tests/txinfo29.test
+++ b/tests/txinfo29.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2004 Free Software Foundation, Inc.
+# Copyright (C) 2004, 2011 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
@@ -30,7 +30,7 @@ echo '@setfilename baz.info' > bar.texi
$ACLOCAL
AUTOMAKE_fails --add-missing
-grep '^Makefile.am:1:.*user variable.*INFO_DEPS' stderr
+grep '^Makefile\.am:1:.*user variable.*INFO_DEPS' stderr
grep 'overrides Automake variable.*INFO_DEPS' stderr
$AUTOMAKE -Wno-override
@@ -38,19 +38,20 @@ $AUTOMAKE -Wno-override
# There is only one definition of INFO_DEPS
test 1 = `grep '^INFO_DEPS.*=' Makefile.in | wc -l`
# and it is the right one.
-grep '^INFO_DEPS = foo.info$' Makefile.in
-
+grep '^INFO_DEPS *= *foo.info *$' Makefile.in
# Likewise with AC_SUBST.
cat > Makefile.am << 'END'
info_TEXINFOS = bar.texi
END
-echo 'AC_SUBST([INFO_DEPS])' >>configure.in
+cat >> configure.in << 'END'
+AC_SUBST([INFO_DEPS])
+END
rm -rf autom4te.cache # Make sure autoconf sees the configure.in update.
AUTOMAKE_fails
-grep '^configure.in:4:.*user variable.*INFO_DEPS' stderr
+grep '^configure\.in:4:.*user variable.*INFO_DEPS' stderr
grep 'overrides Automake variable.*INFO_DEPS' stderr
$AUTOMAKE -Wno-override
@@ -58,4 +59,6 @@ $AUTOMAKE -Wno-override
# There is only one definition of INFO_DEPS
test 1 = `grep '^INFO_DEPS.*=' Makefile.in | wc -l`
# and it is the right one.
-grep '^INFO_DEPS = @INFO_DEPS@$' Makefile.in
+grep '^INFO_DEPS *= *@INFO_DEPS@ *$' Makefile.in
+
+:
diff --git a/tests/txinfo3.test b/tests/txinfo3.test
index dcdfcfac5..6af712faa 100755
--- a/tests/txinfo3.test
+++ b/tests/txinfo3.test
@@ -1,6 +1,6 @@
#! /bin/sh
-# Copyright (C) 1997, 2001, 2002, 2003, 2008 Free Software Foundation,
-# Inc.
+# Copyright (C) 1997, 2001, 2002, 2003, 2008, 2011 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
@@ -22,7 +22,9 @@ required='makeinfo tex texi2dvi'
set -e
-echo AC_OUTPUT >> configure.in
+cat >> configure.in << 'END'
+AC_OUTPUT
+END
cat > Makefile.am << 'END'
info_TEXINFOS = textutils.texi
@@ -45,8 +47,10 @@ grep '^INFO_DEPS.*textutils$' Makefile.in
# We should not use single suffix inference rules (with separate
# dependencies), this confuses Solaris make.
-grep '^.texi:$' Makefile.in && Exit 1
-grep 'textutils: textutils.texi' Makefile.in
+grep '^\.texi:$' Makefile.in && Exit 1
+grep 'textutils: *textutils\.texi' Makefile.in
./configure
$MAKE distcheck
+
+:
diff --git a/tests/txinfo4.test b/tests/txinfo4.test
index 1c6a92f36..0c55a1ca8 100755
--- a/tests/txinfo4.test
+++ b/tests/txinfo4.test
@@ -1,5 +1,6 @@
#! /bin/sh
-# Copyright (C) 1997, 2001, 2002, 2003 Free Software Foundation, Inc.
+# Copyright (C) 1997, 2001, 2002, 2003, 2011 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
@@ -29,4 +30,6 @@ echo '@setfilename textutils.frob' > textutils.texi
$ACLOCAL
AUTOMAKE_fails
-grep 'textutils.texi:1:.*textutils.frob.*extension' stderr
+grep 'textutils\.texi:1:.*textutils\.frob.*extension' stderr
+
+:
diff --git a/tests/txinfo5.test b/tests/txinfo5.test
index 0bbc7d9c5..24671131b 100755
--- a/tests/txinfo5.test
+++ b/tests/txinfo5.test
@@ -1,5 +1,6 @@
#! /bin/sh
-# Copyright (C) 1998, 2001, 2002, 2008 Free Software Foundation, Inc.
+# Copyright (C) 1998, 2001, 2002, 2008, 2011 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
@@ -16,8 +17,11 @@
# Test to make sure that texinfo.tex is not required by --cygnus.
# Report from Ian Taylor.
+
. ./defs || Exit 1
+set -e
+
cat >> configure.in << 'END'
AM_MAINTAINER_MODE
END
@@ -28,5 +32,7 @@ END
echo '@setfilename ian.info' > ian.texi
-$ACLOCAL || Exit 1
+$ACLOCAL
$AUTOMAKE --cygnus
+
+:
diff --git a/tests/txinfo6.test b/tests/txinfo6.test
index ad3704ebf..f5b8c0b64 100755
--- a/tests/txinfo6.test
+++ b/tests/txinfo6.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1998, 2001, 2002, 2011 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
@@ -15,8 +15,11 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Test to make sure `.txi' extension works.
+
. ./defs || Exit 1
+set -e
+
cat > Makefile.am << 'END'
info_TEXINFOS = foo.txi
END
@@ -24,7 +27,9 @@ END
echo '@setfilename foo.info' > foo.txi
: > texinfo.tex
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
+
+grep '^\.txi\.info: *$' Makefile.in
-$FGREP '.txi.info' Makefile.in
+:
diff --git a/tests/txinfo7.test b/tests/txinfo7.test
index 466a2160b..9a1dd5ceb 100755
--- a/tests/txinfo7.test
+++ b/tests/txinfo7.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1998, 2001, 2002, 2011 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
@@ -19,15 +19,17 @@
. ./defs || Exit 1
+set -e
+
cat > Makefile.am << 'END'
info_TEXINFOS = textutils.texi
-magic:
- @echo $(DISTFILES)
END
echo '@setfilename textutils.info' > textutils.texi
-$ACLOCAL || Exit 1
-$AUTOMAKE -a || Exit 1
+$ACLOCAL
+$AUTOMAKE -a
test -f texinfo.tex
+
+:
diff --git a/tests/txinfo8.test b/tests/txinfo8.test
index 7975b283c..8dd24a4a7 100755
--- a/tests/txinfo8.test
+++ b/tests/txinfo8.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Free Software
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2011 Free Software
# Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
@@ -21,32 +21,38 @@
. ./defs || Exit 1
-cat > configure.in << 'END'
-AC_INIT
-AC_CONFIG_AUX_DIR(sub)
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
-AC_OUTPUT(Makefile sub/Makefile)
+set -e
+
+cat > configure.in << END
+AC_INIT([$me], [1.0])
+AC_CONFIG_AUX_DIR([auxdir])
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
END
cat > Makefile.am << 'END'
info_TEXINFOS = textutils.texi
+.PHONY: test1 test2
+test1:
+ @echo DISTFILES = $(DISTFILES)
+ echo ' ' $(DISTFILES) ' ' | grep '[ /]auxdir/texinfo\.tex '
+test2: distdir
+ ls -l $(distdir)/*
+ test -f $(distdir)/auxdir/texinfo.tex
END
echo '@setfilename textutils.info' > textutils.texi
-test -d sub || mkdir sub
+mkdir auxdir
-cat > sub/Makefile.am << 'END'
-magic:
- @echo $(DISTFILES)
-END
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
-$ACLOCAL || Exit 1
-$AUTOMAKE -a || Exit 1
+test -f auxdir/texinfo.tex
-$FGREP -v @SET_MAKE@ sub/Makefile.in > sub/Makefile.sed
-test -f sub/texinfo.tex &&
-$MAKE -s -f sub/Makefile.sed SHELL=$SHELL magic | grep 'texinfo\.tex'
-stat=$?
+./configure
+$MAKE test1 test2
-Exit $stat
+:
diff --git a/tests/txinfo9.test b/tests/txinfo9.test
index b9eb7b5fa..71b5efb6d 100755
--- a/tests/txinfo9.test
+++ b/tests/txinfo9.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2011 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
@@ -14,12 +14,12 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Make sure we only create dist-info target once.
-# This is just an example -- basically for many targets in texinfos.am
-# we only want them to appear once.
+# Make sure we only create texinfo-related targets once.
. ./defs || Exit 1
+set -e
+
cat > Makefile.am << 'END'
info_TEXINFOS = maude.texi liver.txi heart.texinfo
END
@@ -29,7 +29,15 @@ echo '@setfilename liver.info' > liver.txi
echo '@setfilename heart.info' > heart.texinfo
: > texinfo.tex
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
+
+# These are just examples -- basically for many targets in texinfos.am
+# we only want them to appear once. But grepping them all would be
+# overkill.
+for t in info dist-info dvi-am install-html uninstall-pdf-am; do
+ $EGREP "(^| )$t*.:" Makefile.in # help in debugging
+ test `$EGREP -c "(^| )$t(:| *.:)" Makefile.in` -eq 1
+done
-test `grep '^dist-info:' Makefile.in | wc -l` -eq 1
+:
diff --git a/tests/vtexi.test b/tests/vtexi.test
index c28a356ad..e9a45111f 100755
--- a/tests/vtexi.test
+++ b/tests/vtexi.test
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003
-# Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2011 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
@@ -15,8 +15,13 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# Basic checks and some regressions testing on `version.texi'
+# support for texinfo files.
+
. ./defs || Exit 1
+set -e
+
cat > Makefile.am << 'END'
info_TEXINFOS = textutils.texi
END
@@ -30,9 +35,7 @@ END
: > mdate-sh
: > texinfo.tex
-set -e
-
-$ACLOCAL || Exit 1
+$ACLOCAL
$AUTOMAKE
# Test for bug reported by Jim Meyering:
@@ -41,25 +44,22 @@ $AUTOMAKE
# textutils.info: textutils.texi
# instead of
# textutils.info: textutils.texi version.texi
-# (Today this should be `textutils.info: version.texi')
-
-grep 'textutils\.info:.*version\.texi$' Makefile.in
-
+# Today this should be:
+# $(srcdir)/textutils.info: $(srcdir)/version.texi
+# or:
+# $(srcdir)/textutils.info: version.texi
+grep '^\$(srcdir)/textutils\.info:.*[ /]version\.texi *$' Makefile.in
# Test for bug reported by Lars Hecking:
# When running the first version of configure.ac aware automake,
# @CONFIGURE_AC@ was not properly substituted.
-
$EGREP 'stamp-vti:.*textutils\.texi( .*)?$' Makefile.in
$EGREP 'stamp-vti:.*\$\(top_srcdir\)/configure( .*)?$' Makefile.in
-
# Check that the path to mdate-sh is correct. Over escaping of `$'
# etc. once led to `\$\(srcdir\)/mdate-sh'.
+# Filter out '$(srcdir)/mdate-sh'; there should be no occurrences
+# of `.../mdate-sh' left then.
+sed 's,\$(srcdir)/mdate-sh,,g' Makefile.in | grep '/mdate-sh' && Exit 1
-# Filter out '$(srcdir)/mdate-sh'; output occurrences of `SOMETHING/mdate-sh'
-sed -n 's,\$(srcdir)/mdate-sh,,g;s,.* \([^ ]*/mdate-sh\) .*,\1,gp' Makefile.in|
-# There must remain nothing.
- grep . && Exit 1
-
-Exit 0
+:
diff --git a/tests/vtexi2.test b/tests/vtexi2.test
index f6a2bf4e6..00e4c1e79 100755
--- a/tests/vtexi2.test
+++ b/tests/vtexi2.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1996, 1997, 2001, 2002, 2010 Free Software Foundation,
+# Copyright (C) 1996, 1997, 2001, 2002, 2011 Free Software Foundation,
# Inc.
#
# This program is free software; you can redistribute it and/or modify
@@ -40,4 +40,6 @@ END
$ACLOCAL
$AUTOMAKE
-grep '^zardoz\.dvi:' Makefile.in
+grep '^zardoz\.dvi:.*[ /]version.texi' Makefile.in
+
+:
diff --git a/tests/vtexi3.test b/tests/vtexi3.test
new file mode 100755
index 000000000..34f46c55c
--- /dev/null
+++ b/tests/vtexi3.test
@@ -0,0 +1,124 @@
+#! /bin/sh
+# Copyright (C) 2011 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/>.
+
+# Check that vers*.texi files are automatically created and distributed
+# if @included into a texi source. Also check that they correctly contain
+# the @values definitions they are advertised to.
+# See also the related test `vtexi4.test', which does similar checks, but
+# for version.texi only, and requires makeinfo, tex and texi2dvi.
+
+. ./defs || Exit 1
+
+set -e
+
+distdir=$me-7.45.3a
+
+# This should work without tex, texinfo or makeinfo
+TEX=false TEXI2DVI=false MAKEINFO=false
+export TEX TEXI2DVI MAKEINFO
+
+cat > configure.in << END
+AC_INIT([$me], [7.45.3a])
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+info_TEXINFOS = foobar.texi quux.texi zardoz.texi
+.PHONY: echo-distfiles
+echo-distfiles:
+ @echo ' ' $(DISTFILES) ' '
+END
+
+cat > foobar.texi << 'END'
+@setfilename foobar.info
+random text
+@include version.texi
+END
+
+cat > quux.texi << 'END'
+@setfilename quux.info
+@include version-quux.texi
+random text
+END
+
+cat > zardoz.texi << 'END'
+@setfilename zardoz.info
+some randome text
+@include vers1a_2b.texi
+more random text
+END
+
+# Required when using Texinfo.
+: > texinfo.tex
+cp "$testsrcdir/../lib/mdate-sh" .
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+day='([1-9]|1[0-9]|2[0-9]|3[01])'
+month='(January|February|March|April|May|June|July|August|September|October|November|December)'
+year='20[0-9][0-9]' # Hopefully automake will be obsolete in 80 years ;-)
+date="$day $month $year"
+
+do_check ()
+{
+ # Basename of the vers*.texi file.
+ vfile=$1
+ # The $(srcdir) of the current build.
+ srcdir=$2
+ # The vers*.texi file must be created in $(srcdir).
+ $MAKE $srcdir/$vfile.texi
+ cat $srcdir/$vfile.texi
+ # EDITION and VERSION are synonyms, as per documentation.
+ grep "^@set EDITION 7\\.45\\.3a$" $srcdir/$vfile.texi
+ grep "^@set VERSION 7\\.45\\.3a$" $srcdir/$vfile.texi
+ # Check that UPDATED seems right, and that UPDATED and UPDATED-MONTH
+ # are consistent.
+ $EGREP "^@set UPDATED $date$" $srcdir/$vfile.texi
+ vmonth=`grep '^@set UPDATED ' $srcdir/$vfile.texi | awk '{print $4, $5}'`
+ grep "^@set UPDATED-MONTH $vmonth$" $srcdir/$vfile.texi
+ # Check that the vers*.texi file is distributed according
+ # to $(DISTFILES).
+ $MAKE echo-distfiles # For debugging.
+ $MAKE -s echo-distfiles | grep "[ /]$vfile\\.texi"
+}
+
+mkdir build
+cd build
+../configure
+
+do_check version ..
+do_check version-quux ..
+do_check vers1a_2b ..
+
+# The various $(srcdir)/*.info are required for the distribution
+# and they must be newer than version.texi, so that make won't try
+# to rebuild them.
+$sleep
+touch ../foobar.info
+touch ../quux.info
+touch ../zardoz.info
+# Check that the vers*.texi files are really distributed.
+$MAKE distdir
+ls -l $distdir
+diff ../version.texi $distdir/version.texi
+diff ../version-quux.texi $distdir/version-quux.texi
+diff ../version.texi $distdir/vers1a_2b.texi
+
+:
diff --git a/tests/vtexi4.test b/tests/vtexi4.test
new file mode 100755
index 000000000..3c8ab4103
--- /dev/null
+++ b/tests/vtexi4.test
@@ -0,0 +1,118 @@
+#! /bin/sh
+# Copyright (C) 2011 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/>.
+
+# Check that the version.texi file is automatically created and distributed
+# if @included into a texi source. Also check that is correctly defined
+# @values definitions it is advertised to.
+# See also the related test `vtexi3.test', which does similar checks, but
+# for more vers*.texi files, and does not require makeinfo, tex and
+# texi2dvi.
+
+required='makeinfo tex texi2dvi-o'
+. ./defs || Exit 1
+
+set -e
+
+case `LC_ALL=C date '+%u'` in
+ [1-7]) date_is_posix=:;;
+ *) date_is_posx=false;;
+esac
+$date_is_posix \
+ && day=`LC_ALL=C date '+%d'` && test -n "$day" \
+ && month=`LC_ALL=C date '+%B'` && test -n "$month" \
+ && year=`LC_ALL=C date '+%Y'`&& test -n "$year" \
+ || { echo "$me: 'date' is not POSIX-compliant enough"; Exit 77; }
+day=`echo "$day" | sed 's/^0//'`
+
+# This test requires a grep program that can work on non-text input.
+(echo 'x' | grep x) || {
+ echo "$me: grep doesn't work on input that is not pure text" >&2
+ Exit 77
+}
+
+cat > configure.in << END
+AC_INIT([$me], [123.456])
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+END
+
+cat > defs.am <<END
+my_date_rx = $day $month $year
+my_month_rx = $month $year
+my_version_rx = 123\.456
+END
+
+cat > Makefile.am << 'END'
+include defs.am
+info_TEXINFOS = foo.texi
+test-grepinfo:
+## Not useless uses of cat: we only tested that grep worked on
+## non-text input when that's given from a pipe.
+ cat $(srcdir)/foo.info | grep 'GREPVERSION=$(my_version_rx)='
+ cat $(srcdir)/foo.info | grep 'GREPEDITION=$(my_version_rx)='
+ cat $(srcdir)/foo.info | grep 'GREPDATE=$(my_date_rx)='
+ cat $(srcdir)/foo.info | grep 'GREPMONTH=$(my_month_rx)='
+test-distfiles:
+ @echo DISTFILES = $(DISTFILES)
+ echo ' ' $(DISTFILES) ' ' | grep '[ /]version.texi '
+test-distdir: distdir
+ ls -l $(distdir)
+ diff $(srcdir)/version.texi $(distdir)/version.texi
+.PHONY: test-grepinfo test-distfiles test-distdir
+check-local: test-grepinfo test-distfiles test-distdir
+END
+
+cat > foo.texi << 'END'
+\input texinfo
+@c %**start of header
+@setfilename foo.info
+@settitle Zardoz
+@c %**end of header
+
+@node Top
+@include version.texi
+
+GREPVERSION=@value{VERSION}=
+
+GREPEDITION=@value{EDITION}=
+
+GREPDATE=@value{UPDATED}=
+
+GREPMONTH=@value{UPDATED-MONTH}=
+
+@bye
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+./configure
+$MAKE all dvi
+
+# debugging & sanity checks
+ls -l
+cat version.texi
+cat foo.info
+test -f foo.dvi
+
+$MAKE test-grepinfo
+$MAKE test-distfiles
+$MAKE test-distdir
+$MAKE distcheck
+
+: