automake-commit
[Top][All Lists]
Advanced

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

[Automake-commit] [SCM] GNU Automake branch, master, updated. v1.11-409-


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, master, updated. v1.11-409-g4555c81
Date: Sat, 06 Nov 2010 20:25:23 +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=4555c818e5ae6a90a8116e9c5b5b1ff6a65929c0

The branch, master has been updated
       via  4555c818e5ae6a90a8116e9c5b5b1ff6a65929c0 (commit)
       via  d3369343ca79dd1fd112c35eaa20f65bf43cdc02 (commit)
      from  f7adc0f46ecd072da071e5d6f166988e4288285e (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 4555c818e5ae6a90a8116e9c5b5b1ff6a65929c0
Merge: f7adc0f d336934
Author: Stefano Lattarini <address@hidden>
Date:   Sat Nov 6 20:49:22 2010 +0100

    Merge branch 'backcompat-tests'
    
    Conflicts:
        tests/Makefile.in

commit d3369343ca79dd1fd112c35eaa20f65bf43cdc02
Author: Stefano Lattarini <address@hidden>
Date:   Fri Jun 18 12:56:47 2010 +0200

    New tests on obsoleted usages of automake/autoconf macros.
    
    * tests/backcompat.test: New test script.
    * tests/backcompat2.test: Likewise.
    * tests/backcompat3.test: Likewise.
    * tests/backcompat4.test: Likewise.
    * tests/backcompat5.test: Likewise.
    * tests/backcompat6.test: Likewise.
    * tests/init.test: Extended and improved, esp. by trying more
    combinations of calls to AC_INIT and AM_INIT_AUTOMAKE with few
    arguments.
    * tests/Makefile.am (TESTS): Updated.

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

Summary of changes:
 ChangeLog                                     |   15 +++
 tests/Makefile.am                             |    6 +
 tests/Makefile.in                             |   19 ++-
 tests/backcompat.test                         |   66 +++++++++++
 tests/backcompat2.test                        |   67 +++++++++++
 tests/backcompat3.test                        |  153 +++++++++++++++++++++++++
 tests/{help-depend2.test => backcompat4.test} |   54 ++++++---
 tests/backcompat5.test                        |  119 +++++++++++++++++++
 tests/backcompat6.test                        |  105 +++++++++++++++++
 tests/init.test                               |   29 +++--
 10 files changed, 600 insertions(+), 33 deletions(-)
 create mode 100755 tests/backcompat.test
 create mode 100755 tests/backcompat2.test
 create mode 100755 tests/backcompat3.test
 copy tests/{help-depend2.test => backcompat4.test} (51%)
 create mode 100755 tests/backcompat5.test
 create mode 100755 tests/backcompat6.test

diff --git a/ChangeLog b/ChangeLog
index a40dbc5..657ea37 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,20 @@
 2010-11-06  Stefano Lattarini  <address@hidden>
 
+       New tests on obsoleted usages of automake/autoconf macros (such
+       as AC_INIT, AM_INIT_AUTOMAKE and AC_OUTPUT).
+       * tests/backcompat.test: New test script.
+       * tests/backcompat2.test: Likewise.
+       * tests/backcompat3.test: Likewise.
+       * tests/backcompat4.test: Likewise.
+       * tests/backcompat5.test: Likewise.
+       * tests/backcompat6.test: Likewise.
+       * tests/init.test: Extended and improved, esp. by trying more
+       combinations of calls to AC_INIT and AM_INIT_AUTOMAKE with few
+       arguments.
+       * tests/Makefile.am (TESTS): Updated.
+
+2010-11-06  Stefano Lattarini  <address@hidden>
+
        Fix bug in rules for creating vala vapi/header files.
        * automake.in (lang_vala_finish_target): Add forgotten "fi" in an
        if control structure in a generated make rules.  Bug introduced
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 59bf4a0..d5ae622 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -164,6 +164,12 @@ auxdir.test \
 auxdir2.test \
 auxdir3.test \
 auxdir4.test \
+backcompat.test \
+backcompat2.test \
+backcompat3.test \
+backcompat4.test \
+backcompat5.test \
+backcompat6.test \
 backsl.test \
 backsl2.test \
 backsl3.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index e040ecd..deab171 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -284,12 +284,12 @@ EXTRA_DIST = ChangeLog-old gen-parallel-tests 
instspc-tests.sh \
        $(TESTS)
 XFAIL_TESTS = all.test auxdir2.test cond17.test gcj6.test txinfo5.test \
        $(instspc_xfail_tests)
-parallel_tests = check-p.test check10-p.test check11-p.test \
-       check2-p.test check3-p.test check4-p.test check5-p.test \
-       check6-p.test check7-p.test check8-p.test check9-p.test \
-       color-p.test color2-p.test comment9-p.test dejagnu-p.test \
-       exeext4-p.test maken3-p.test maken4-p.test pr401-p.test \
-       pr401b-p.test pr401c-p.test
+parallel_tests = backcompat5-p.test check-p.test check10-p.test \
+       check11-p.test check2-p.test check3-p.test check4-p.test \
+       check5-p.test check6-p.test check7-p.test check8-p.test \
+       check9-p.test color-p.test color2-p.test comment9-p.test \
+       dejagnu-p.test exeext4-p.test maken3-p.test maken4-p.test \
+       pr401-p.test pr401b-p.test pr401c-p.test
 instspc_tests = instspc-squote-build.test instspc-squote-install.test \
        instspc-dquote-build.test instspc-dquote-install.test \
        instspc-bquote-build.test instspc-bquote-install.test \
@@ -422,6 +422,12 @@ auxdir.test \
 auxdir2.test \
 auxdir3.test \
 auxdir4.test \
+backcompat.test \
+backcompat2.test \
+backcompat3.test \
+backcompat4.test \
+backcompat5.test \
+backcompat6.test \
 backsl.test \
 backsl2.test \
 backsl3.test \
@@ -1457,6 +1463,7 @@ uninstall-am:
        maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
        pdf-am ps ps-am recheck recheck-html uninstall uninstall-am
 
+backcompat5-p.log: backcompat5.test
 check-p.log: check.test
 check10-p.log: check10.test
 check11-p.log: check11.test
diff --git a/tests/backcompat.test b/tests/backcompat.test
new file mode 100755
index 0000000..3367db2
--- /dev/null
+++ b/tests/backcompat.test
@@ -0,0 +1,66 @@
+#! /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 usage of AM_INIT_AUTOMAKE with two ot three arguments, for
+# backward-compatibility.
+
+. ./defs || Exit 1
+
+set -e
+
+cat > Makefile.am <<'END'
+.PHONY: test display
+
+## Might be useful for debugging.
+display:
+       ## The following should be substituted by AM_INIT_AUTOMAKE.
+       @echo PACKAGE = $(PACKAGE)
+       @echo VERSION = $(VERSION)
+       ## The following should not be substituted, as we used the
+       ## old form of AC_INIT.
+       @echo PACKAGE_NAME = $(PACKAGE_NAME)
+       @echo PACKAGE_VERSION = $(PACKAGE_VERSION)
+       @echo PACKAGE_TARNAME = $(PACKAGE_TARNAME)
+       @echo PACKAGE_STRING = $(PACKAGE_STRING)
+
+test: display
+       test x'$(PACKAGE)' = x'FooBar'
+       test x'$(VERSION)' = x'0.7.1'
+       test x'$(PACKAGE_NAME)' = x
+       test x'$(PACKAGE_VERSION)' = x
+       test x'$(PACKAGE_TARNAME)' = x
+       test x'$(PACKAGE_STRING)' = x
+END
+
+for ac_init in 'AC_INIT' 'AC_INIT([Makefile.am])'; do
+  for am_extra_args in '' ', []' ', [:]' ', [false]'; do
+    rm -rf autom4te*.cache config* Makefile.in Makefile
+    cat > configure.in <<END
+$ac_init
+AM_INIT_AUTOMAKE([FooBar], [0.7.1]$am_extra_args)
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+END
+    cat configure.in # might be useful for debugging
+    $ACLOCAL
+    $AUTOCONF
+    $AUTOMAKE
+    ./configure
+    $MAKE test
+  done
+done
+
+:
diff --git a/tests/backcompat2.test b/tests/backcompat2.test
new file mode 100755
index 0000000..0967720
--- /dev/null
+++ b/tests/backcompat2.test
@@ -0,0 +1,67 @@
+#! /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/>.
+
+# Backward-compatibility test: check that AM_INIT_AUTOMAKE with two or
+# three arguments does AC_DEFINE the symbols PACKAGE and VERSION iff the
+# third argument is empty or non-existent.
+
+. ./defs || Exit 1
+
+set -e
+
+# A trick to make the test run muuuch faster, by avoiding repeated
+# runs of aclocal (one order of magnitude improvement in speed!).
+echo 'AC_INIT(x,0) AM_INIT_AUTOMAKE' > configure.in
+$ACLOCAL
+rm -rf configure.in autom4te.*
+
+cat > config.h.in <<'END'
+#undef PACKAGE
+#undef VERSION
+END
+
+for am_arg3 in ':' 'false' '#' ' '; do
+  cat > configure.in <<END
+AC_INIT
+AC_CONFIG_HEADERS([config.h])
+AM_INIT_AUTOMAKE([pkgname], [pkgversion], [$am_arg3])
+AC_OUTPUT
+END
+  cat configure.in # might be useful for debugging
+  $AUTOCONF
+  ./configure
+  cat config.h # might be useful for debugging
+  # The non-empty third argument should prevent PACKAGE and VERSION
+  # from being AC_DEFINE'd.
+  $EGREP 'pkg(name|version)' config.h && Exit 1
+done
+
+for am_extra_args in '' ',' ', []'; do
+  cat > configure.in <<END
+AC_INIT
+AC_CONFIG_HEADERS([config.h])
+AM_INIT_AUTOMAKE([pkgname], [pkgversion]$am_extra_args)
+AC_OUTPUT
+END
+  cat configure.in # might be useful for debugging
+  $AUTOCONF
+  ./configure
+  cat config.h # might be useful for debugging
+  grep '^ *# *define  *PACKAGE  *"pkgname" *$' config.h
+  grep '^ *# *define  *VERSION  *"pkgversion" *$' config.h
+done
+
+:
diff --git a/tests/backcompat3.test b/tests/backcompat3.test
new file mode 100755
index 0000000..f07eaff
--- /dev/null
+++ b/tests/backcompat3.test
@@ -0,0 +1,153 @@
+#! /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/>.
+
+# Backward-compatibility test: check what happens when AC_INIT and
+# AM_INIT_AUTOMAKE are both given two or more arguments.
+
+. ./defs || Exit 1
+
+set -e
+
+empty=''
+
+cat > Makefile.am <<'END'
+## Leading `:;' here required to work around bugs of (at least) bash 3.2
+got: Makefile
+       @:; { \
+         echo 'PACKAGE = $(PACKAGE)'; \
+         echo 'VERSION = $(VERSION)'; \
+         echo 'PACKAGE_NAME = $(PACKAGE_NAME)'; \
+         echo 'PACKAGE_VERSION = $(PACKAGE_VERSION)'; \
+         echo 'PACKAGE_STRING = $(PACKAGE_STRING)'; \
+         echo 'PACKAGE_TARNAME = $(PACKAGE_TARNAME)'; \
+         echo 'PACKAGE_BUGREPORT = $(PACKAGE_BUGREPORT)'; \
+         echo 'PACKAGE_URL = $(PACKAGE_URL)'; \
+       } >$@
+END
+
+
+### Run 1 ###
+
+cat > configure.in <<END
+AC_INIT([ac_name], [ac_version])
+AM_INIT_AUTOMAKE([am_name], [am_version])
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+END
+
+cat configure.in
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+
+cat >exp <<END
+PACKAGE = am_name
+VERSION = am_version
+PACKAGE_NAME = ac_name
+PACKAGE_VERSION = ac_version
+PACKAGE_STRING = ac_name ac_version
+PACKAGE_TARNAME = ac_name
+PACKAGE_BUGREPORT = $empty
+PACKAGE_URL = $empty
+END
+
+$MAKE got
+
+diff exp got
+
+
+### Run 2 ###
+
+cat > configure.in <<'END'
+dnl#  `AC_INIT' in Autoconf <= 2.63 doesn't have an URL argument.
+dnl#  Luckily, `AC_AUTOCONF_VERSION' and `m4_version_prereq' are
+dnl#  both present in autoconf 2.62, which we require; so that we
+dnl#  can at least use the following workaround.
+m4_version_prereq([2.64],
+    [AC_INIT([ac_name], [ac_version], [ac_bugreport], [ac_tarname],
+             [ac_url])],
+    [AC_INIT([ac_name], [ac_version], [ac_bugreport], [ac_tarname])
+     AC_SUBST([PACKAGE_URL], [ac_url])])
+AM_INIT_AUTOMAKE([am_name], [am_version])
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+END
+
+cat configure.in
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+
+cat >exp <<END
+PACKAGE = am_name
+VERSION = am_version
+PACKAGE_NAME = ac_name
+PACKAGE_VERSION = ac_version
+PACKAGE_STRING = ac_name ac_version
+PACKAGE_TARNAME = ac_tarname
+PACKAGE_BUGREPORT = ac_bugreport
+PACKAGE_URL = ac_url
+END
+
+$MAKE got
+
+diff exp got
+
+
+### Run 3 ###
+
+cat > configure.in <<END
+AC_INIT([ac_name], [ac_version])
+AM_INIT_AUTOMAKE([am_name], [am_version], [am_foo_quux])
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+END
+
+cat configure.in
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+
+cat >exp <<END
+PACKAGE = am_name
+VERSION = am_version
+PACKAGE_NAME = ac_name
+PACKAGE_VERSION = ac_version
+PACKAGE_STRING = ac_name ac_version
+PACKAGE_TARNAME = ac_name
+PACKAGE_BUGREPORT = $empty
+PACKAGE_URL = $empty
+END
+
+$MAKE got
+
+diff exp got
+
+$FGREP am_foo_quux Makefile.in Makefile configure config.status && Exit 1
+
+
+### Done ###
+
+:
diff --git a/tests/help-depend2.test b/tests/backcompat4.test
similarity index 51%
copy from tests/help-depend2.test
copy to tests/backcompat4.test
index b4133b4..1bee059 100755
--- a/tests/help-depend2.test
+++ b/tests/backcompat4.test
@@ -14,29 +14,51 @@
 # 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 that when automake automatically activates support for
-# dependency tracking, it adds proper text to the configure help screen.
-# Keep this in sync with sister test `help-depend.test'
+# Backward-compatibility: AC_OUTPUT with arguments.
 
 . ./defs || Exit 1
 
 set -e
 
-cat > configure.in <<END
+mkdir sub
+: > Makefile.am
+: > zardoz
+: > foo.in
+: > foo1.in
+: > foo2.in
+: > foo3.in
+: > sub/bar.in
+
+ls -l # might be useful for debugging
+
+for args in \
+  'foo' \
+  'foo:foo1.in' \
+  'foo:zardoz' \
+  'foo:sub/bar.in' \
+  'foo:foo1.in:foo2.in' \
+  'foo:zardoz:zardoz' \
+  'foo:foo1.in:foo2.in:foo3.in' \
+  'foo:foo1.in:foo2.in:sub/bar.in:foo3.in' \
+; do
+  cat >configure.in <<END
 AC_INIT([$me], [1.0])
 AM_INIT_AUTOMAKE
-AC_PROG_CC
+AC_CONFIG_FILES([$args])
+AC_OUTPUT
 END
-
-$ACLOCAL
-$AUTOCONF
-
-./configure --help >stdout || { cat stdout; Exit 1; }
-cat stdout
-
-$FGREP ' --enable-dependency-tracking ' stdout
-$FGREP ' --disable-dependency-tracking ' stdout
-$FGREP ' one-time build' stdout
-$FGREP ' slow dependency extract' stdout
+  $ACLOCAL
+  $AUTOMAKE Makefile
+  mv -f Makefile.in Makefile.acf
+  cat >configure.in <<END
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE
+AC_OUTPUT([$args])
+END
+  $ACLOCAL
+  $AUTOMAKE Makefile
+  mv -f Makefile.in Makefile.aco
+  diff Makefile.acf Makefile.aco
+done
 
 :
diff --git a/tests/backcompat5.test b/tests/backcompat5.test
new file mode 100755
index 0000000..b68316d
--- /dev/null
+++ b/tests/backcompat5.test
@@ -0,0 +1,119 @@
+#! /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/>.
+
+# Backward-compatibility test: try to build and distribute a package
+# using obsoleted forms of AC_INIT, AM_INIT_AUTOMAKE and AC_OUTPUT.
+# This script can also serve as mild stress-testing for Automke.
+# See also the similar test `backcompat6.test'.
+
+. ./defs || Exit 1
+
+set -e
+
+# Yuck!
+cat > configure.in <<'END'
+dnl. Everything here is *deliberately* underquoted!
+AC_INIT(src/foo.input)
+AM_INIT_AUTOMAKE(foo, 1.0)
+AC_CONFIG_FILES(Makefile:mkfile.in)
+AC_OUTPUT(hacky/Makefile src/Makefile data/Makefile tests/Makefile)
+END
+
+distdir=foo-1.0
+
+cat > mkfile.am <<'END'
+SUBDIRS = src data tests hacky
+installcheck-local:
+       grep DataDataData $(DESTDIR)$(prefix)/data/$(PACKAGE)-$(VERSION)/bar
+END
+
+mkdir hacky src tests data
+
+echo 'This is a dummy package' > README
+
+cat > src/foo.input <<'END'
+#!sh
+echo Zardoz
+END
+
+cat > tests/a.test <<'END'
+#!/bin/sh
+"$srcdir/../src/foo" | grep Zardoz
+END
+chmod a+x tests/a.test
+
+cat > data/bar <<'END'
+line1
+line2
+line3
+END
+
+cat >hacky/Makefile.am <<'END'
+dist-hook:
+       find $(top_distdir) -print ## useful for debugging
+       chmod a+rx $(top_distdir)/tests/*.test
+END
+
+cat > src/Makefile.am <<'END'
+dist_bin_SCRIPTS = foo
+foo: foo.input
+       sed '1s,^#!.*$$,#!/bin/sh,' $(srcdir)/foo.input >$@
+       chmod a+x $@
+EXTRA_DIST = foo.input
+DISTCLEANFILES = foo
+END
+
+cat > data/Makefile.am <<'END'
+nodist_data_DATA = bar
+datadir = $(prefix)/data/$(PACKAGE)-$(VERSION)
+bar:
+       echo DataDataData >$@
+distclean-local:
+       rm -f bar
+END
+
+cat > tests/Makefile.am <<'END'
+TESTS = a.test
+EXTRA_DIST = $(TESTS)
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+ls -l . hacky src data tests # useful for debugging
+test ! -f mkfile
+$MAKE
+$MAKE distdir
+test ! -f $distdir/Makefile.in
+test ! -f $distdir/data/bar
+test -f $distdir/src/foo
+diff README $distdir/README
+diff mkfile.in $distdir/mkfile.in
+diff tests/a.test $distdir/tests/a.test
+diff src/foo.input $distdir/src/foo.input
+
+$MAKE check
+$MAKE distcheck
+
+test -f $distdir.tar.gz
+
+chmod a-x tests/a.test
+# dist-hook should take care of making test files executables
+$MAKE distcheck
+
+:
diff --git a/tests/backcompat6.test b/tests/backcompat6.test
new file mode 100755
index 0000000..534ecb1
--- /dev/null
+++ b/tests/backcompat6.test
@@ -0,0 +1,105 @@
+#! /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/>.
+
+# Backward-compatibility test: try to build and distribute a package
+# using obsoleted forms of AC_INIT, AM_INIT_AUTOMAKE and AC_OUTPUT.
+# This script can also serve as mild stress-testing for Automke.
+# See also the similar test `backcompat5.test'.
+
+. ./defs || Exit 1
+
+set -e
+
+# Anyone doing something like this in a real-life package probably
+# deserves to be killed.
+cat > configure.in <<'END'
+dnl. Everything here is *deliberately* underquoted!
+AC_INIT(quux.c)
+PACKAGE=nonesuch-zardoz
+VERSION=nonesuch-0.1
+AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
+AC_SUBST(one,1)
+two=2
+AC_SUBST(two, $two)
+three=3
+AC_SUBST(three)
+AC_PROG_CC
+AC_CONFIG_HEADERS(config.h:config.hin)
+AC_OUTPUT(Makefile foo.got:foo1.in:foo2.in:foo3.in)
+END
+
+echo @one@ > foo1.in
+echo @two@ > foo2.in
+echo @three@ > foo3.in
+
+cat >config.hin <<'END'
+#undef PACKAGE
+#undef VERSION
+END
+
+cat >> Makefile.am <<'END'
+bin_PROGRAMS = foo
+foo_SOURCES = quux.c
+DISTCLEANFILES = *.tmp
+check-local:
+       rm -f exp got
+       echo 'PACKAGE = nonesuch-zardoz' > exp.tmp
+       echo 'VERSION = nonesuch-0.1' >> exp.tmp
+       echo 'PACKAGE = $(PACKAGE)' > got1.tmp
+       echo 'VERSION = $(VERSION)' >> got1.tmp
+       ./foo > got2.tmp
+       cat exp.tmp
+       cat got1.tmp
+       cat got2.tmp
+       diff exp.tmp got1.tmp
+       diff exp.tmp got2.tmp
+END
+
+cat > quux.c <<'END'
+#include <config.h>
+#include <stdio.h>
+int main (void)
+{
+  printf("PACKAGE = %s\nVERSION = %s\n", PACKAGE, VERSION);
+  return 0;
+}
+END
+
+$ACLOCAL
+$AUTOMAKE
+$AUTOCONF
+
+./configure
+
+cat >foo.exp <<'END'
+1
+2
+3
+END
+
+diff foo.exp foo.got
+
+$MAKE
+$MAKE check
+
+distdir=nonesuch-zardoz-nonesuch-0.1
+$MAKE distdir
+test -f $distdir/quux.c
+test ! -f $distdir/foo.got
+
+$MAKE distcheck
+
+:
diff --git a/tests/init.test b/tests/init.test
index 38ec681..895bad6 100755
--- a/tests/init.test
+++ b/tests/init.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2006, 2008, 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
@@ -14,20 +14,27 @@
 # 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 give a sensible error message when neither AC_INIT nor
-# AM_INIT_AUTOMAKE are given arguments.
+# Make sure we give a sensible error message when AC_INIT and
+# AM_INIT_AUTOMAKE are both given less than two arguments.
 
 . ./defs || Exit 1
 
 set -e
 
-cat >configure.in <<END
-AC_INIT
-AM_INIT_AUTOMAKE
+for ac_init_args in '' '([x])'; do
+  for am_init_args in '' '([1.10])'; do
+    rm -rf aclocal.m4 autom4te*.cache
+    cat >configure.in <<END
+AC_INIT$ac_init_args
+AM_INIT_AUTOMAKE$am_init_args
 END
+    cat configure.in # might be useful for debugging
+    # The error message should mention AC_INIT, not AC_PACKAGE_VERSION.
+    ($ACLOCAL && $AUTOCONF) 2>stderr && { cat stderr >&2; Exit 1; }
+    cat stderr >&2
+    $FGREP AC_PACKAGE_VERSION stderr && Exit 1
+    grep 'configure\.in:.* AC_INIT .*arguments' stderr
+  done
+done
 
-# The error message should mension AC_INIT, not AC_PACKAGE_VERSION.
-($ACLOCAL && $AUTOCONF) 2>stderr && { cat stderr >&2; Exit 1; }
-cat stderr >&2
-grep AC_PACKAGE_VERSION stderr && Exit 1
-grep AC_INIT stderr
+:


hooks/post-receive
-- 
GNU Automake



reply via email to

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