automake-commit
[Top][All Lists]
Advanced

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

[Automake-commit] [SCM] GNU Automake branch, maint, updated. v1.11-276-g


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, maint, updated. v1.11-276-g3d8d5ec
Date: Tue, 11 Jan 2011 23:05:16 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Automake".

http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=3d8d5ec1c85f43aaa78e373dfe30f5d397cd5819

The branch, maint has been updated
       via  3d8d5ec1c85f43aaa78e373dfe30f5d397cd5819 (commit)
       via  c8c0a64515e4ed1e08c8eddb9e5dfd06ce987577 (commit)
      from  51b68122c3abc0503e8eddfc188645c9109d76c4 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 3d8d5ec1c85f43aaa78e373dfe30f5d397cd5819
Merge: 51b6812 c8c0a64
Author: Stefano Lattarini <address@hidden>
Date:   Tue Jan 11 22:50:21 2011 +0100

    Merge branch 'tests-autodist' into maint

commit c8c0a64515e4ed1e08c8eddb9e5dfd06ce987577
Author: Stefano Lattarini <address@hidden>
Date:   Mon Jan 10 23:56:43 2011 +0100

    tests: add checks on automatically-distributed files
    
    Related to automake bug#7819.
    
    * tests/autodist.test: New test.
    * tests/autodist-subdir.test: Likewise.
    * tests/autodist-acconfig.test: Likewise.
    * tests/autodist-acconfig-no-subdir.test: Likewise.
    * tests/autodist-aclocal-m4.test: Likewise.
    * tests/autodist-config-headers.test: Likewise.
    * tests/autodist-configure-no-subdir.test: Likewise.
    * tests/autodist-stamp-vti.test: Likewise.
    * tests/Makefile.am (TESTS): Update.

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                          |   14 ++
 tests/Makefile.am                                  |    8 +
 tests/Makefile.in                                  |    8 +
 ...lpha2.test => autodist-acconfig-no-subdir.test} |   49 +++----
 tests/{extra10.test => autodist-acconfig.test}     |   26 ++--
 tests/{extra10.test => autodist-aclocal-m4.test}   |   35 +++--
 tests/autodist-config-headers.test                 |   61 ++++++++
 tests/autodist-configure-no-subdir.test            |   72 ++++++++++
 tests/{txinfo2.test => autodist-stamp-vti.test}    |   36 +++--
 tests/autodist-subdir.test                         |  147 ++++++++++++++++++++
 tests/autodist.test                                |  136 ++++++++++++++++++
 11 files changed, 530 insertions(+), 62 deletions(-)
 copy tests/{alpha2.test => autodist-acconfig-no-subdir.test} (55%)
 copy tests/{extra10.test => autodist-acconfig.test} (68%)
 copy tests/{extra10.test => autodist-aclocal-m4.test} (52%)
 create mode 100755 tests/autodist-config-headers.test
 create mode 100755 tests/autodist-configure-no-subdir.test
 copy tests/{txinfo2.test => autodist-stamp-vti.test} (57%)
 create mode 100755 tests/autodist-subdir.test
 create mode 100755 tests/autodist.test

diff --git a/ChangeLog b/ChangeLog
index f260ca5..869d685 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2011-01-10   Stefano Lattarini  <address@hidden>
+
+       tests: add checks on automatically-distributed files
+       Related to automake bug#7819.
+       * tests/autodist.test: New test.
+       * tests/autodist-subdir.test: Likewise.
+       * tests/autodist-acconfig.test: Likewise.
+       * tests/autodist-acconfig-no-subdir.test: Likewise.
+       * tests/autodist-aclocal-m4.test: Likewise.
+       * tests/autodist-config-headers.test: Likewise.
+       * tests/autodist-configure-no-subdir.test: Likewise.
+       * tests/autodist-stamp-vti.test: Likewise.
+       * tests/Makefile.am (TESTS): Update.
+
 2011-01-11  Stefano Lattarini  <address@hidden>
 
        tests: work around a texi+cygnus bug causing a spurious XFAIL
diff --git a/tests/Makefile.am b/tests/Makefile.am
index a6ed4c2..890e69b 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -94,6 +94,14 @@ ar2.test \
 asm.test \
 asm2.test \
 asm3.test \
+autodist.test \
+autodist-subdir.test \
+autodist-acconfig.test \
+autodist-acconfig-no-subdir.test \
+autodist-aclocal-m4.test \
+autodist-config-headers.test \
+autodist-configure-no-subdir.test \
+autodist-stamp-vti.test \
 autohdr.test \
 autohdr2.test \
 autohdr3.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index bcfd478..7600c14 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -361,6 +361,14 @@ ar2.test \
 asm.test \
 asm2.test \
 asm3.test \
+autodist.test \
+autodist-subdir.test \
+autodist-acconfig.test \
+autodist-acconfig-no-subdir.test \
+autodist-aclocal-m4.test \
+autodist-config-headers.test \
+autodist-configure-no-subdir.test \
+autodist-stamp-vti.test \
 autohdr.test \
 autohdr2.test \
 autohdr3.test \
diff --git a/tests/alpha2.test b/tests/autodist-acconfig-no-subdir.test
similarity index 55%
copy from tests/alpha2.test
copy to tests/autodist-acconfig-no-subdir.test
index e125377..e6bd5a9 100755
--- a/tests/alpha2.test
+++ b/tests/autodist-acconfig-no-subdir.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003  Free Software Foundation, Inc.
+# 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
@@ -14,48 +14,45 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Another check for README-alpha support.  This time it is requested
-# from configure.in.  Report from Akim Demaille.
+# Check that `acconfig.h' is *not* automatically distributed when
+# placed in a subdirectory.
+# Related to automake bug#7819.
 
 . ./defs || Exit 1
 
 set -e
 
-cat > configure.in << 'END'
-AC_INIT([alpha], [1.0b])
-AM_INIT_AUTOMAKE([readme-alpha])
-AC_CONFIG_FILES([Makefile sub/Makefile])
+cat >> configure.in <<END
+AC_CONFIG_FILES([sub/Makefile])
 AC_OUTPUT
 END
 
-cat > Makefile.am << 'END'
+cat > Makefile.am <<'END'
 SUBDIRS = sub
+sub/acconfig.h:
+       echo target $@ should not be built >&2; exit 1
 check-local: distdir
-       test -f $(distdir)/README-alpha
-       test -f $(distdir)/sub/README
-       test ! -f $(distdir)/sub/README-alpha
-       : > works
+       ls -l $(distdir)/sub
+       test ! -f $(distdir)/sub/acconfig.h
 END
 
 mkdir sub
-: > sub/Makefile.am
 
-: > README-alpha
-: > sub/README-alpha
-: > sub/README
+cat > sub/Makefile.am <<'END'
+acconfig.h:
+       echo target $@ should not be built >&2; exit 1
+check-local:
+       echo $(DISTFILES) | grep 'acconfig\.h' && exit 1; :
+       echo $(DIST_COMMON) | grep 'acconfig\.h' && exit 1; :
+END
 
-# Gnits stuff.
-: > INSTALL
-: > NEWS
-: > README
-: > COPYING
-: > AUTHORS
-: > ChangeLog
-: > THANKS
+: > sub/acconfig.h
 
 $ACLOCAL
-$AUTOCONF
 $AUTOMAKE
+$AUTOCONF
+
 ./configure
 $MAKE check
-test -f works
+
+:
diff --git a/tests/extra10.test b/tests/autodist-acconfig.test
similarity index 68%
copy from tests/extra10.test
copy to tests/autodist-acconfig.test
index 7bd6556..49ab2f0 100755
--- a/tests/extra10.test
+++ b/tests/autodist-acconfig.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2010  Free Software Foundation, Inc.
+# 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
@@ -14,31 +14,33 @@
 # 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 wildcards in EXTRA_DIST are honoured.
-# Suggested by observations from Braden McDaniel.
+# Check that `acconfig.h' is automatically distributed if it exists
+# (at automake runtime).
+# Related to automake bug#7819.
 
-required=GNUmake
 . ./defs || Exit 1
 
 set -e
 
-echo AC_OUTPUT >> configure.in
+cat >> configure.in <<END
+AC_OUTPUT
+END
 
 cat > Makefile.am <<'END'
-EXTRA_DIST=*.foo
 .PHONY: test
 test: distdir
-       diff a.foo $(distdir)/a.foo
-       diff b.foo $(distdir)/b.foo
-       test ! -r $(distdir)/c.bar
+       ls -l $(distdir)
+       echo ' ' $(DIST_COMMON) ' ' | grep '[ /]acconfig\.h '
+       test -f $(distdir)/acconfig.h
 END
 
+: > acconfig.h
+
 $ACLOCAL
 $AUTOMAKE
 $AUTOCONF
 
-echo aaa > a.foo
-echo bbb > b.foo
-echo ccc > c.foo
 ./configure
 $MAKE test
+
+:
diff --git a/tests/extra10.test b/tests/autodist-aclocal-m4.test
similarity index 52%
copy from tests/extra10.test
copy to tests/autodist-aclocal-m4.test
index 7bd6556..3f53d59 100755
--- a/tests/extra10.test
+++ b/tests/autodist-aclocal-m4.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2010  Free Software Foundation, Inc.
+# 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
@@ -14,31 +14,42 @@
 # 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 wildcards in EXTRA_DIST are honoured.
-# Suggested by observations from Braden McDaniel.
+# Check that `aclocal.m4' is not automatically distributed if not
+# required to build `configure'.  This is *really* a corner-case
+# check, and the behaviour it checks is not documented either, so
+# if that behaviour is deliberately changed in the future, just
+# remove this test.
+# Related to automake bug#7819.
 
-required=GNUmake
 . ./defs || Exit 1
 
 set -e
 
-echo AC_OUTPUT >> configure.in
+{ echo 'm4_include([defs.m4])'
+  cat configure.in
+  echo 'AC_OUTPUT'
+} > t
+mv -f t configure.in
 
 cat > Makefile.am <<'END'
-EXTRA_DIST=*.foo
 .PHONY: test
 test: distdir
-       diff a.foo $(distdir)/a.foo
-       diff b.foo $(distdir)/b.foo
-       test ! -r $(distdir)/c.bar
+       ls -l $(distdir)
+       test ! -f $(distdir)/aclocal.m4
+       echo $(DISTFILES) | grep 'aclocal\.m4' && exit 1; :
+       echo $(DIST_COMMON) | grep 'aclocal\.m4' && exit 1; :
+check-local: test
 END
 
+: > defs.m4
 $ACLOCAL
+mv -f aclocal.m4 defs.m4
+
 $AUTOMAKE
 $AUTOCONF
 
-echo aaa > a.foo
-echo bbb > b.foo
-echo ccc > c.foo
 ./configure
 $MAKE test
+$MAKE distcheck
+
+:
diff --git a/tests/autodist-config-headers.test 
b/tests/autodist-config-headers.test
new file mode 100755
index 0000000..66c9bea
--- /dev/null
+++ b/tests/autodist-config-headers.test
@@ -0,0 +1,61 @@
+#! /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 config.h.bot and config.h.top are automatically
+# distributed if the AC_CONFIG_HADERS macro is used and they
+# exist at automake runtime.
+# Related to automake bug#7819.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in <<END
+AC_CONFIG_HEADERS([config.h sub/config.h cfg2.h:conf2.hin])
+AC_OUTPUT
+END
+
+cat > Makefile.am <<'END'
+.PHONY: test
+test: distdir
+       ls -l $(distdir) $(distdir)/sub
+       echo ' ' $(DIST_COMMON) ' ' | grep '[ /]config\.h\.bot '
+       echo ' ' $(DIST_COMMON) ' ' | grep '[ /]config\.h\.top '
+       echo ' ' $(DIST_COMMON) ' ' | grep '[ /]cfg2\.h\.bot '
+       echo ' ' $(DIST_COMMON) ' ' | grep '[ /]cfg2\.h\.top '
+       echo ' ' $(DIST_COMMON) ' ' | grep '[ /]sub/config\.h\.bot '
+       echo ' ' $(DIST_COMMON) ' ' | grep '[ /]sub/config\.h\.top '
+       test -f $(distdir)/config.h.bot
+       test -f $(distdir)/config.h.top
+       test -f $(distdir)/cfg2.h.bot
+       test -f $(distdir)/cfg2.h.top
+       test -f $(distdir)/sub/config.h.bot
+       test -f $(distdir)/sub/config.h.top
+END
+
+mkdir sub
+touch config.h.in config.h.top config.h.bot \
+      conf2.hin cfg2.h.top cfg2.h.bot \
+      sub/config.h.in sub/config.h.top sub/config.h.bot
+
+$ACLOCAL
+$AUTOMAKE
+$AUTOCONF
+
+./configure
+$MAKE test
+
+:
diff --git a/tests/autodist-configure-no-subdir.test 
b/tests/autodist-configure-no-subdir.test
new file mode 100755
index 0000000..db640c4
--- /dev/null
+++ b/tests/autodist-configure-no-subdir.test
@@ -0,0 +1,72 @@
+#! /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 `configure', `configure.ac' and `configure.in' are *not*
+# automatically distributed when placed in a subdirectory.
+# Related to automake bug#7819.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in <<END
+AC_CONFIG_FILES([sub/Makefile])
+AC_OUTPUT
+END
+
+cat > Makefile.am <<'END'
+SUBDIRS = sub
+dontbuild = echo target $@ should not be built >&2; exit 1
+sub/configure:
+       $(dontbuild)
+sub/configure.ac:
+       $(dontbuild)
+sub/configure.in:
+       $(dontbuild)
+check-local: distdir
+       ls -l $(distdir)/sub
+       test ! -f $(distdir)/sub/configure
+       test ! -f $(distdir)/sub/configure.in
+       test ! -f $(distdir)/sub/configure.ac
+END
+
+mkdir sub
+
+cat > sub/Makefile.am <<'END'
+dontbuild = echo target $@ should not be built >&2; exit 1
+configure:
+       $(dontbuild)
+configure.ac:
+       $(dontbuild)
+configure.in:
+       $(dontbuild)
+check-local:
+       echo $(DISTFILES) | grep 'configure' && exit 1; :
+       echo $(DIST_COMMON) | grep 'configure' && exit 1; :
+END
+
+: > sub/configure.ac
+: > sub/configure.in
+: > sub/configure
+
+$ACLOCAL
+$AUTOMAKE
+$AUTOCONF
+
+./configure
+$MAKE check
+
+:
diff --git a/tests/txinfo2.test b/tests/autodist-stamp-vti.test
similarity index 57%
copy from tests/txinfo2.test
copy to tests/autodist-stamp-vti.test
index f51d0b6..4f37e14 100755
--- a/tests/txinfo2.test
+++ b/tests/autodist-stamp-vti.test
@@ -1,6 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1996, 1997, 2001, 2002, 2003, 2011 Free Software
-# Foundation, Inc.
+# 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
@@ -15,32 +14,45 @@
 # 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 that a ".info~" file doesn't end up in the
-# distribution.  Bug report from Greg McGary.
+# Check that `stamp-vti' is automatically distributed when info_TEXINFOS
+# and version.texi are involved.
+# Related to automake bug#7819.
 
+required=makeinfo
 . ./defs || Exit 1
 
 set -e
 
-cat >> configure.in << 'END'
+cat >> configure.in << END
 AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
-info_TEXINFOS = textutils.texi
+info_TEXINFOS = foo.texi
 .PHONY: test
-test:
-       @echo DISTFILES = $(DISTFILES)
-       case '$(DISTFILES)' in *'~'*) exit 1;; *) exit 0;; esac
+test: all distdir
+       ls -l $(distdir)
+       echo ' ' $(DIST_COMMON) ' ' | grep '[ /]stamp-vti '
+       test -f $(distdir)/stamp-vti
 END
 
+cat > foo.texi << 'END'
+\input texinfo
address@hidden foo.info
address@hidden Zardoz
address@hidden Top
address@hidden version.texi
+bar baz quux
address@hidden
+END
+
+# Required when using Texinfo.
 : > texinfo.tex
-echo '@setfilename textutils.info' > textutils.texi
-: > textutils.info~
+cp "$testsrcdir/../lib/mdate-sh" .
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE
+$AUTOMAKE -a
 
 ./configure
 $MAKE test
diff --git a/tests/autodist-subdir.test b/tests/autodist-subdir.test
new file mode 100755
index 0000000..db694f8
--- /dev/null
+++ b/tests/autodist-subdir.test
@@ -0,0 +1,147 @@
+#! /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 automake really automatically distributes all the files
+# it advertises to do, even when in subdirectories.
+#
+# This behavior might be suboptimal, but it has been in place for quite
+# a long time, and it would be risky to change it now.  See also the
+# discussion of automake bug#7819:
+#  <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7819>
+#
+# Keep this test in sync with sister test `autodist.test'.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in <<'END'
+AC_CONFIG_FILES([sub/Makefile])
+AC_OUTPUT
+END
+
+$ACLOCAL
+$AUTOCONF
+
+# The automake manual states that the list of automatically-distributed
+# files should be given by `automake --help'.
+list=`$AUTOMAKE --help \
+        | sed -n '/^Files .*automatically distributed.*if found/,/^ *$/p' \
+        | sed 1d`
+list=`for f in $list; do
+        case $f in
+          configure|configure.in|configure.ac)
+            # See test 'autodist-configure-no-subdir.test'.
+            ;;
+          aclocal.m4)
+            # This file should be distributed only when it is a real
+            # dependency for configure.  Anyway, not a check to be
+            # performed in this test.
+            ;;
+          acconfig.h)
+            # Works only when it really exists, not when it is a
+            # target in Makefile.am.
+            ;;
+          stamp-vti)
+            # Works only when using info_TEXINFOS and version.texi.
+            ;;
+          config.h.bot|config.h.top)
+            # Works only when the AC_CONFIG_HADERS macro is used.
+            ;;
+          *)
+            echo $f
+            ;;
+        esac
+      done`
+# Normalize whitespace, just in case.
+list=`echo $list`
+
+test -n "$list"
+
+cat > Makefile.am <<'END'
+SUBDIRS = sub
+check-local:
+## For debugging.
+       @echo DIST_COMMON:
+       @for f in $(DIST_COMMON); do echo "  $$f"; done
+       @echo DISTDIR:
+       @ls -l $(distdir) | sed 's/^/  /'
+## Now the checks.
+       @for f in $(autodist_list); do \
+         echo "file: sub/$$f"; \
+         test -f $(distdir)/sub/$$f \
+           || { echo $$f: distdir fail >&2; exit 1; }; \
+       done
+END
+
+mkdir sub
+
+cat > sub/Makefile.am <<'END'
+include distfiles.am
+check-local:
+## For debugging.
+       @echo DIST_COMMON:
+       @for f in $(DIST_COMMON); do echo "  $$f"; done
+       @echo DISTDIR:
+       @ls -l $(distdir) | sed 's/^/  /'
+## Now the checks.
+       @for f in $(autodist_list); do \
+         echo "file: $$f"; \
+         ## Some filenames might contain dots, but this won't cause spurious
+         ## failures, and "spurious successes" are so unlikely that they're
+         ## not worth worrying about.
+         echo ' ' $(DIST_COMMON) ' ' | grep "[ /]$$f " >/dev/null \
+           || { echo $$f: distcom fail >&2; exit 1; }; \
+       done
+END
+
+: First try listing the automatically-distributed files in proper
+: targets in Makefile.am
+
+echo "MAINTAINERCLEANFILES = $list" > sub/distfiles.am
+for f in $list; do echo "$f :; touch $f"; done >> sub/distfiles.am
+
+cat sub/distfiles.am # For debugging.
+
+$AUTOMAKE -a
+
+./configure
+
+$MAKE distdir
+autodist_list="$list" $MAKE check
+
+$MAKE maintainer-clean
+test ! -f sub/README    # Sanity check.
+rm -rf $me-1.0          # Remove $(distdir).
+
+: Now try creating the automatically-distributed files before
+: running automake.
+
+: > sub/distfiles.am
+for f in $list; do
+  echo dummy > sub/$f
+done
+
+ls -l # For debugging.
+
+$AUTOMAKE
+
+./configure
+
+$MAKE distdir
+autodist_list="$list" $MAKE check
+
+:
diff --git a/tests/autodist.test b/tests/autodist.test
new file mode 100755
index 0000000..34b9526
--- /dev/null
+++ b/tests/autodist.test
@@ -0,0 +1,136 @@
+#! /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 automake really automatically distributes all the files
+# it advertises to do.
+# Related to automake bug#7819.
+# Keep this test in sync with sister test `autodist-subdir.test'.
+
+. ./defs || Exit 1
+
+set -e
+
+# Ensure we are run from the right directory.
+# (The last thing we want is to delete some random user files.)
+test -f ../defs-static
+rm -f *
+
+cat > configure.in <<END
+AC_INIT([$me], [1.0])
+AC_CONFIG_AUX_DIR([.])
+AM_INIT_AUTOMAKE
+## Will avoid useless regeneration of aclocal.m4, configure, etc.
+AM_MAINTAINER_MODE
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+END
+
+$ACLOCAL
+$AUTOCONF
+
+# The automake manual states that the list of automatically-distributed
+# files should be given by `automake --help'.
+list=`$AUTOMAKE --help \
+        | sed -n '/^Files .*automatically distributed.*if found/,/^ *$/p' \
+        | sed 1d`
+list=`for f in $list; do
+        case $f in
+          configure|configure.in|configure.ac)
+            # See test 'autodist-configure-no-subdir.test'.
+            ;;
+          aclocal.m4)
+            # This file should be distributed only when it is a real
+            # dependency for configure.  Anyway, not a check to be
+            # performed in this test.
+            ;;
+          acconfig.h)
+            # Works only when it really exists, not when it is a
+            # target in Makefile.am.
+            ;;
+          stamp-vti)
+            # Works only when using info_TEXINFOS and version.texi.
+            ;;
+          config.h.bot|config.h.top)
+            # Works only when the AC_CONFIG_HADERS macro is used.
+            ;;
+          *)
+            echo $f
+            ;;
+        esac
+      done`
+# Normalize whitespace, just in case.
+list=`echo $list`
+
+test -n "$list"
+
+cat > Makefile.am <<'END'
+include distfiles.am
+check-local:
+## For debugging.
+       @echo DIST_COMMON:
+       @for f in $(DIST_COMMON); do echo "  $$f"; done
+       @echo DISTDIR:
+       @ls -l $(distdir) | sed 's/^/  /'
+## Now the checks.
+       @for f in $(autodist_list); do \
+         echo "file: $$f"; \
+         test -f $(distdir)/$$f \
+           || { echo $$f: distdir fail >&2; exit 1; }; \
+         ## Some filenames might contain dots, but this won't cause spurious
+         ## failures, and "spurious successes" are so unlikely that they're
+         ## not worth worrying about.
+         echo ' ' $(DIST_COMMON) ' ' | grep "[ /]$$f " >/dev/null \
+           || { echo $$f: distcom fail >&2; exit 1; }; \
+       done
+END
+
+: First try listing the automatically-distributed files in proper
+: targets in Makefile.am
+
+echo "MAINTAINERCLEANFILES = $list" > distfiles.am
+for f in $list; do echo "$f :; touch $f"; done >> distfiles.am
+
+cat distfiles.am # For debugging.
+
+$AUTOMAKE -a
+
+./configure
+
+$MAKE distdir
+autodist_list="$list" $MAKE check
+
+$MAKE maintainer-clean
+test ! -f README        # Sanity check.
+rm -rf $me-1.0          # Remove $(distdir).
+
+: Now try creating the automatically-distributed files before
+: running automake.
+
+: > distfiles.am
+for f in $list; do
+  echo dummy > $f
+done
+
+ls -l # For debugging.
+
+$AUTOMAKE
+
+./configure
+
+$MAKE distdir
+autodist_list="$list" $MAKE check
+
+:


hooks/post-receive
-- 
GNU Automake



reply via email to

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