2010-09-08 Stefano Lattarini <stefano.lattarini@gmail.com>
+ Make some `confh*.test' tests more "semantic" (plus tweakings).
+ * tests/confh.test: Run "autoconf", "configure" and "make check",
+ instead of munging/grepping the generated `Makefile.in'.
+ * tests/confh4.test: Relax the grepping of Makefile.in w.r.t.
+ white spaces. Do not create usless dummy source file `foo.c'
+ and useless dummy header file `acconfig.h'.
+ (configure.in): Remove superfluous call to `AC_OUTPUT'.
+ * tests/confh6.test: Add trailing `:' command.
+ * tests/confh7.test: In comments, add reference to ...
+ * tests/confh8.test: ... this new test, "semantic" sister
+ of `confh7.test'.
+ * tests/Makefile.am (TESTS): Updated.
+ Prompted by a report from Ralf Wildenhues.
+
Remove useless whitespace padding in XFAIL_TESTS definition.
* tests/Makefile.am (XFAIL_TESTS): Remove whitespace padding.
confh5.test \
confh6.test \
confh7.test \
+confh8.test \
confincl.test \
conflnk.test \
conflnk2.test \
cat >> configure.in << 'END'
AM_CONFIG_HEADER([include/config.h])
+AC_OUTPUT
END
-: > Makefile.am
-: > acconfig.h
+cat > Makefile.am << 'END'
+.PHONY: test1 test2
+test1:
+ @echo DIST_COMMON = $(DIST_COMMON) ## for debugging
+ echo ' ' $(DIST_COMMON) ' ' | grep '[ /]acconfig\.h '
+test2: distdir
+ ls -l $(distdir)/* ## for debugging
+ test -f $(distdir)/acconfig.h
+check-local: test1 test2
+END
mkdir include
-: > include/Makefile.am
: > include/config.h.in
+: > acconfig.h
+
+# The test used to fail if `include/Makefile.am' was created (!)
+: > include/Makefile.am
$ACLOCAL
+$AUTOCONF
$AUTOMAKE
-perl -ne '
-if (s/^DIST_COMMON *=//)
-{
- $_ .= <> while (s/\\$//);
- $_ = " $_ ";
- s/\s+/ /g;
- print "$_\n";
- exit 0;
-}' Makefile.in > dc.txt
-cat dc.txt # might be useful for debugging.
-$FGREP ' acconfig.h ' dc.txt
+./configure
+
+$MAKE test1
+$MAKE test2
+$MAKE distcheck
# Make sure re-running automake in a different way generates same
# Makefile.in.
AC_CONFIG_FILES([include/Makefile])
AM_CONFIG_HEADER([include/config.h])
AC_PROG_CC
-AC_OUTPUT
END
cat > Makefile.am << 'END'
foo_SOURCES = foo.c
END
-: > foo.c
-: > acconfig.h
-
mkdir include
: > include/Makefile.am
: > include/config.h.in
$ACLOCAL
$AUTOMAKE
-grep '^DEFAULT_INCLUDES =.* -I\$(top_builddir)/include' Makefile.in
+grep '^ *DEFAULT_INCLUDES *=.* -I\$(top_builddir)/include' Makefile.in
:
$FGREP gRePmE subdir/config.h
$MAKE distcheck
+
+:
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Test to make sure several config headers are allowed.
+# See also sister "semantic" test `confh8.test'.
. ./defs || Exit 1
--- /dev/null
+#! /bin/sh
+# Copyright (C) 2010 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/>.
+
+# Test to make sure several config headers are allowed.
+# See also sister "minimalistic" test `confh7.test'.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AM_CONFIG_HEADER([one.h two.h])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+.PHONY: test0 test1 test2
+test0:
+ @echo DIST_COMMON = $(DIST_COMMON) ## for debugging
+ echo ' ' $(DIST_COMMON) ' ' | grep '[ /]one\.h\.in '
+ echo ' ' $(DIST_COMMON) ' ' | grep '[ /]two\.h\.in '
+ : Processed header files should not be distributed.
+ if echo ' ' $(DIST_COMMON) ' ' | grep '\.h '; then \
+ exit 1; \
+ else \
+ exit 0; \
+ fi
+test1: all
+ test -f one.h
+ test -f two.h
+test2: distdir
+ ls -l $(distdir)/* ## for debugging
+ test -f $(distdir)/one.h.in
+ test -f $(distdir)/two.h.in
+ : Processed header files should not be distributed.
+ test ! -r $(distdir)/one.h
+ test ! -r $(distdir)/two.h
+check-local: test0 test1 test2
+END
+
+: > one.h.in
+: > two.h.in
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+
+$MAKE test0
+$MAKE test1
+$MAKE test2
+$MAKE distcheck
+
+: