automake-patches
[Top][All Lists]
Advanced

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

Re: [PATCH 4/9] Warnings win over strictness in AM_INIT_AUTOMAKE.


From: Stefano Lattarini
Subject: Re: [PATCH 4/9] Warnings win over strictness in AM_INIT_AUTOMAKE.
Date: Fri, 14 Jan 2011 00:11:27 +0100
User-agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; )

[Ralf Wildenhues]
> > >  If some code later calls it like
> > >   process_option_list (first-set-of-options);
> > >   process_option_list (second-set-of-options);
> > > 
> > > then things will go wrong again.  I suspect that it will mean that
> > >   AM_INIT_AUTOMAKE([foreign -Wno-portability])
> > >   AUTOMAKE_OPTIONS = gnu
> > > 
> > > won't do what we want.  Hmm.  What exactly is it that we want to happen
> > > in this case?  Should gnu override -Wno-portability if specified in a
> > > (to-be) higher order place?
> > >
[Stefano Lattarini]
> > I assumed without saying that yes, this was to be the intended behaviour.
> > And I still think it should be.  Sorry for not having been explicit about
> > that before.
[Ralf Wildenhues]
> 
> I agree that it should be, but this, too, should be documented (in
> autoconf.texi and maybe also NEWS) and tested, when it works.
> 
What about the attached patch?  It also adds a test for another situation
I hadn't thought about previously.

OK to apply the patch in a new commit between [PATCH 2/9] and [PATCH 3/9]?

Regards,
   Stefano
From 02668242613812bce666243dafc1e12edf317b13 Mon Sep 17 00:00:00 2001
From: Stefano Lattarini <address@hidden>
Date: Thu, 13 Jan 2011 23:57:16 +0100
Subject: [PATCH] More tests on warnings and strictness.

* tests/warnings-strictness-interactions.test: New test.
* tests/warnings-unknown.test: Likewise.
* tests/Makefile.am (TESTS): Update.
---
 ChangeLog                                   |    7 +++
 tests/Makefile.am                           |    2 +
 tests/Makefile.in                           |    2 +
 tests/warnings-strictness-interactions.test |   59 +++++++++++++++++++++++++++
 tests/warnings-unknown.test                 |   44 ++++++++++++++++++++
 5 files changed, 114 insertions(+), 0 deletions(-)
 create mode 100755 tests/warnings-strictness-interactions.test
 create mode 100755 tests/warnings-unknown.test

diff --git a/ChangeLog b/ChangeLog
index 7956b15..efa43d1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2011-01-02  Stefano Lattarini  <address@hidden>
 
+       More tests on warnings and strictness.
+       * tests/warnings-strictness-interactions.test: New test.
+       * tests/warnings-unknown.test: Likewise.
+       * tests/Makefile.am (TESTS): Update.
+
+2011-01-02  Stefano Lattarini  <address@hidden>
+
        New test on silent-rules mode and portability warnings.
        * tests/silent-nowarn.test: New test.
        * tests/Makefile.am (TESTS): Update.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 53dbe9c..972f8a9 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -947,6 +947,8 @@ vtexi3.test \
 vtexi4.test \
 warnings-override.test \
 warnings-precedence.test \
+warnings-strictness-interactions.test \
+warnings-unknown.test \
 warnopts.test \
 werror.test \
 werror2.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index f2d695f..282afe0 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -1210,6 +1210,8 @@ vtexi3.test \
 vtexi4.test \
 warnings-override.test \
 warnings-precedence.test \
+warnings-strictness-interactions.test \
+warnings-unknown.test \
 warnopts.test \
 werror.test \
 werror2.test \
diff --git a/tests/warnings-strictness-interactions.test 
b/tests/warnings-strictness-interactions.test
new file mode 100755
index 0000000..e2c7675
--- /dev/null
+++ b/tests/warnings-strictness-interactions.test
@@ -0,0 +1,59 @@
+#! /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 default warnings triggered by a strictness specified
+# in AUTOMAKE_OPTIONS take precedence over explicit warnings given in
+# AM_INIT_AUTOMAKE.
+
+. ./defs || Exit 1
+
+# We want (almost) complete control over automake options.
+AUTOMAKE="$original_AUTOMAKE -Werror"
+
+cat > Makefile.am <<END
+AUTOMAKE_OPTIONS =
+FOO := bar
+END
+
+set_am_opts ()
+{
+  set +x
+  sed <$2 >$2-t -e "s|^\\(AUTOMAKE_OPTIONS\\) *=.*|\\1 = $1|" \
+                -e "s|^\\(AM_INIT_AUTOMAKE\\).*|\\1([$1])|"
+  mv -f $2-t $2
+  set -x
+  cat $2
+}
+
+set_am_opts '-Wportability' configure.in
+set_am_opts 'foreign' Makefile.am
+
+$ACLOCAL
+$AUTOMAKE
+
+rm -rf autom4te*.cache
+
+# Files required in gnu strictness.
+touch README INSTALL NEWS AUTHORS ChangeLog COPYING
+
+set_am_opts '-Wno-portability' configure.in
+set_am_opts 'gnu' Makefile.am
+
+AUTOMAKE_fails
+$ACLOCAL
+grep '^Makefile\.am:2:.*:=.*not portable' stderr
+
+:
diff --git a/tests/warnings-unknown.test b/tests/warnings-unknown.test
new file mode 100755
index 0000000..77ed589
--- /dev/null
+++ b/tests/warnings-unknown.test
@@ -0,0 +1,44 @@
+#! /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 complains about unknown warnings.
+
+. ./defs || Exit 1
+
+# We want (almost) complete control over automake options.
+AUTOMAKE="$original_AUTOMAKE --foreign -Werror"
+
+cat > configure.in <<END
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE([-Wno-zardoz])
+AC_CONFIG_FILES([Makefile])
+END
+
+cat > Makefile.am <<END
+AUTOMAKE_OPTIONS = -Wfoobar
+END
+
+$ACLOCAL
+
+AUTOMAKE_fails -Wbazquux
+grep '^configure\.in:2:.* unknown warning category.*zardoz' stderr
+grep '^Makefile\.am:1:.* unknown warning category.*foobar' stderr
+grep '^automake:.* unknown warning category.*bazquux' stderr
+
+# Check that we can override warnings about unknown warning categories.
+$AUTOMAKE -Wno-unsupported -Wbazquux
+
+:
-- 
1.7.2.3


reply via email to

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