]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
tests: add test about deprecated use of AC_INIT
authorStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 17 Mar 2011 22:18:36 +0000 (23:18 +0100)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 17 Mar 2011 22:24:34 +0000 (23:24 +0100)
* tests/deprecated-acinit.test: New test, check that automake
and autoconf complain about an old-style AC_INIT call used with
a new-style AM_AUTOMAKE_INIT call.
* tests/Makefile.am (TESTS): Update.

ChangeLog
tests/Makefile.am
tests/Makefile.in
tests/deprecated-acinit.test [new file with mode: 0755]

index 5b666d77073eb446ed9108e9ae5d11c0d3e1ce87..ee6c69c9b0af6fc4ca2699576e533ba9c96dfc6d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2011-03-17  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       tests: add test about deprecated use of AC_INIT
+       * tests/deprecated-acinit.test: New test, check that automake
+       and autoconf complain about an old-style AC_INIT call used with
+       a new-style AM_AUTOMAKE_INIT call.
+       * tests/Makefile.am (TESTS): Update.
+
 2011-03-04  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
        tests: fix bug (comments-in-var-defn.test + autoconf 2.62)
index c0efdc37e8d80f18162421a87c0b9fe514680366..121d0a6a27414798b66e9f9bbe6fa50c1560c036 100644 (file)
@@ -377,6 +377,7 @@ depend3.test \
 depend4.test \
 depend5.test \
 depend6.test \
+deprecated-acinit.test \
 destdir.test \
 dirforbid.test \
 dirlist.test \
index 311b5240295cab09a4f28b7f829ca3c3eb58a6e8..1fe16e0ca71cf767aa237fc951398f0c52d32d86 100644 (file)
@@ -639,6 +639,7 @@ depend3.test \
 depend4.test \
 depend5.test \
 depend6.test \
+deprecated-acinit.test \
 destdir.test \
 dirforbid.test \
 dirlist.test \
diff --git a/tests/deprecated-acinit.test b/tests/deprecated-acinit.test
new file mode 100755 (executable)
index 0000000..a25d32c
--- /dev/null
@@ -0,0 +1,52 @@
+#! /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 and autoconf complain about an old-style AC_INIT
+# call used with a new-style AM_AUTOMAKE_INIT call.
+
+. ./defs || Exit 1
+
+: > Makefile.am
+
+# We'll need a proper aclocal.m4, but aclocal is expected to fail
+# later, so get and store it now.
+$ACLOCAL
+mv aclocal.m4 aclocal-m4.sav
+
+errmsg='AC_INIT should be called with package and version argument'
+
+for ac_init in AC_INIT 'AC_INIT([Makefile.am])'; do
+  for am_init_automake in AM_INIT_AUTOMAKE 'AM_INIT_AUTOMAKE([1.11])'; do
+    rm -rf autom4te*.cache aclocal.m4
+    unindent > configure.in <<END
+        $ac_init
+        $am_init_automake
+        AC_CONFIG_FILES([Makefile])
+END
+    cat configure.in # might be useful for debugging
+    $ACLOCAL 2>stderr && { cat stderr >&2; Exit 1; }
+    cat stderr >&2
+    grep "^configure\\.in:.* $errmsg" stderr
+    cp aclocal-m4.sav aclocal.m4
+    $AUTOCONF 2>stderr && { cat stderr >&2; Exit 1; }
+    cat stderr >&2
+    grep "^configure\\.in:.* $errmsg" stderr
+    AUTOMAKE_fails
+    grep "^configure\\.in:.* $errmsg" stderr
+  done
+done
+
+: