[Sorry for the delay] This patch has already been reviewed and ACK'd "with nits addressed", so a new review shouldn't be required. Anyway, the amended patch is attached, for completeness.
Regards, Stefano
From db06f9f159c307fdb469cdf44b3ff2f95f2ef0f2 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini <stefano.lattar...@gmail.com> Date: Mon, 20 Dec 2010 00:46:21 +0100 Subject: [PATCH 1/9] Add new tests on strictness and warnings precedence and overriding. * tests/strictness-overriding.test: New test. * tests/strictness-precedence.test: New test. * tests/warnings-overriding.test: New test. * tests/warnings-precedence.test: New test. * tests/Makefile.am (TESTS): Update. --- ChangeLog | 9 +++ tests/Makefile.am | 6 ++- tests/Makefile.in | 6 ++- tests/strictness-override.test | 125 ++++++++++++++++++++++++++++++++++++++ tests/strictness-precedence.test | 79 ++++++++++++++++++++++++ tests/warnings-override.test | 113 ++++++++++++++++++++++++++++++++++ tests/warnings-precedence.test | 79 ++++++++++++++++++++++++ 7 files changed, 415 insertions(+), 2 deletions(-) create mode 100755 tests/strictness-override.test create mode 100755 tests/strictness-precedence.test create mode 100755 tests/warnings-override.test create mode 100755 tests/warnings-precedence.test diff --git a/ChangeLog b/ChangeLog index 472dc55..40d7b8e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2011-01-02 Stefano Lattarini <stefano.lattar...@gmail.com> + + Add new tests on strictness and warnings precedence and overriding. + * tests/strictness-override.test: New test. + * tests/strictness-precedence.test: New test. + * tests/warnings-override.test: New test. + * tests/warnings-precedence.test: New test. + * tests/Makefile.am (TESTS): Update. + 2011-01-02 Ralf Wildenhues <ralf.wildenh...@gmx.de> Sync auxiliary files from upstream. diff --git a/tests/Makefile.am b/tests/Makefile.am index ea0b64a..e155340 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,7 +1,7 @@ ## Process this file with automake to create Makefile.in # Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +# 2006, 2007, 2008, 2009, 2010, 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 @@ -804,6 +804,8 @@ stdinc.test \ stamph2.test \ stdlib.test \ stdlib2.test \ +strictness-override.test \ +strictness-precedence.test \ strip.test \ strip2.test \ strip3.test \ @@ -929,6 +931,8 @@ version8.test \ vpath.test \ vtexi.test \ vtexi2.test \ +warnings-override.test \ +warnings-precedence.test \ warnopts.test \ werror.test \ werror2.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 9e78c97..b4ddce0 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -16,7 +16,7 @@ @SET_MAKE@ # Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +# 2006, 2007, 2008, 2009, 2010, 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 @@ -1067,6 +1067,8 @@ stdinc.test \ stamph2.test \ stdlib.test \ stdlib2.test \ +strictness-override.test \ +strictness-precedence.test \ strip.test \ strip2.test \ strip3.test \ @@ -1192,6 +1194,8 @@ version8.test \ vpath.test \ vtexi.test \ vtexi2.test \ +warnings-override.test \ +warnings-precedence.test \ warnopts.test \ werror.test \ werror2.test \ diff --git a/tests/strictness-override.test b/tests/strictness-override.test new file mode 100755 index 0000000..35f1763 --- /dev/null +++ b/tests/strictness-override.test @@ -0,0 +1,125 @@ +#! /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/>. + +# The strictness specified in Makefile.am:AUTOMAKE_OPTIONS should +# override that specified in configure.in:AM_INIT_AUTOMAKE, and both +# should override the strictness specified on the command line. +# NOTE: the current semantics might not be the best one (even if it has +# been in place for quite a long time); see also Automake bug #7673. +# Update this test if the semantics are changed. + +. ./defs || Exit 1 + +set -e + +# We want complete control over automake options. +AUTOMAKE=$original_AUTOMAKE + +cat > Makefile.am <<'END' +AUTOMAKE_OPTIONS = +END + +set_strictness () +{ + 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 +} + +ok () +{ + $AUTOMAKE -Werror $* +} + +ko () +{ + AUTOMAKE_fails $* + grep 'required file.*README' stderr +} + +$ACLOCAL + +# Leave out only one of the required files, to avoid too much +# repetition in the error messages. +touch INSTALL NEWS AUTHORS ChangeLog COPYING + +rm -rf autom4te*.cache +set_strictness '' Makefile.am +set_strictness '' configure.in +ko --gnu +ko +ok --foreign + +rm -rf autom4te*.cache +set_strictness 'gnu' Makefile.am +set_strictness '' configure.in +ko --gnu +ko +ko --foreign + +rm -rf autom4te*.cache +set_strictness '' Makefile.am +set_strictness 'gnu' configure.in +ko --gnu +ko +ko --foreign + +rm -rf autom4te*.cache +set_strictness 'foreign' Makefile.am +set_strictness '' configure.in +ok --gnu +ok +ok --foreign + +rm -rf autom4te*.cache +set_strictness '' Makefile.am +set_strictness 'foreign' configure.in +ok --gnu +ok +ok --foreign + +rm -rf autom4te*.cache +set_strictness 'gnu' Makefile.am +set_strictness 'gnu' configure.in +ko --gnu +ko +ko --foreign + +rm -rf autom4te*.cache +set_strictness 'foreign' Makefile.am +set_strictness 'foreign' configure.in +ok --gnu +ok +ok --foreign + +rm -rf autom4te*.cache +set_strictness 'foreign' Makefile.am +set_strictness 'gnu' configure.in +ok --gnu +ok +ok --foreign + +rm -rf autom4te*.cache +set_strictness 'gnu' Makefile.am +set_strictness 'foreign' configure.in +ko --gnu +ko +ko --foreign + +: diff --git a/tests/strictness-precedence.test b/tests/strictness-precedence.test new file mode 100755 index 0000000..a76f2a1 --- /dev/null +++ b/tests/strictness-precedence.test @@ -0,0 +1,79 @@ +#! /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/>. + +# On the command line, in AM_INIT_AUTOMAKE, and in AUTOMAKE_OPTIONS, +# strictness specified later should take precedence over strictness +# specified earlier. + +. ./defs || Exit 1 + +set -e + +# We want complete control over automake options. +AUTOMAKE=$original_AUTOMAKE + +cat > Makefile.am <<'END' +AUTOMAKE_OPTIONS = +END + +set_strictness () +{ + 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 +} + +ok () +{ + $AUTOMAKE -Werror $* +} + +ko () +{ + AUTOMAKE_fails $* + grep 'required file.*README' stderr +} + +# Leave out only one of the required files, to avoid too much +# repetition in the error messages. +touch INSTALL NEWS AUTHORS ChangeLog COPYING + +$ACLOCAL +ko --foreign --gnu +ok --gnu --foreign + +set_strictness '' Makefile.am +set_strictness 'gnu foreign' configure.in +rm -rf autom4te*.cache +$ACLOCAL +ok +set_strictness 'foreign gnu' configure.in +rm -rf autom4te*.cache +$ACLOCAL +ko + +set_strictness '' configure.in +rm -rf autom4te*.cache +$ACLOCAL +set_strictness 'gnu foreign' Makefile.am +ok +set_strictness 'foreign gnu' Makefile.am +ko + +: diff --git a/tests/warnings-override.test b/tests/warnings-override.test new file mode 100755 index 0000000..fad1f12 --- /dev/null +++ b/tests/warnings-override.test @@ -0,0 +1,113 @@ +#! /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/>. + +# The warnings specified in Makefile.am:AUTOMAKE_OPTIONS should override +# those specified in configure.in:AM_INIT_AUTOMAKE, and both should +# override the warnings specified on the command line. +# NOTE: the current semantics might not be the best one (even if it has +# been in place for quite a long time); see also Automake bug #7673. +# Update this test if the semantics are changed. + +. ./defs || Exit 1 + +set -e + +# We want (almost) complete control over automake options. +AUTOMAKE="$original_AUTOMAKE -Werror" + +cat > Makefile.am <<'END' +FOO := bar +AUTOMAKE_OPTIONS = +END + +set_warnings () +{ + 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 +} + +ok () +{ + $AUTOMAKE $* +} + +ko () +{ + AUTOMAKE_fails $* + grep '^Makefile\.am:1:.*:=.*not portable' stderr +} + +$ACLOCAL + +# Files required in gnu strictness. +touch README INSTALL NEWS AUTHORS ChangeLog COPYING + +rm -rf autom4te*.cache +set_warnings '-Wno-portability' Makefile.am +set_warnings '' configure.in + +ok -Wportability +ok + +rm -rf autom4te*.cache +set_warnings '' Makefile.am +set_warnings '-Wno-portability' configure.in + +ok -Wportability +ok + +rm -rf autom4te*.cache +set_warnings '-Wno-portability' Makefile.am +set_warnings '-Wno-portability' configure.in + +ok -Wportability + +rm -rf autom4te*.cache +set_warnings '-Wportability' Makefile.am +set_warnings '' configure.in + +ko +ko -Wno-portability + +rm -rf autom4te*.cache +set_warnings '' Makefile.am +set_warnings '-Wportability' configure.in + +ko +ko -Wno-portability + +rm -rf autom4te*.cache +set_warnings '-Wportability' Makefile.am +set_warnings '-Wportability' configure.in +ko -Wno-portability + +rm -rf autom4te*.cache +set_warnings '-Wno-portability' Makefile.am +set_warnings '-Wportability' configure.in +ok +ok -Wportability + +rm -rf autom4te*.cache +set_warnings '-Wportability' Makefile.am +set_warnings '-Wno-portability' configure.in +ko +ko -Wno-portability + +: diff --git a/tests/warnings-precedence.test b/tests/warnings-precedence.test new file mode 100755 index 0000000..afc73ac --- /dev/null +++ b/tests/warnings-precedence.test @@ -0,0 +1,79 @@ +#! /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/>. + +# On the command line, in AM_INIT_AUTOMAKE, and in AUTOMAKE_OPTIONS, +# warnings specified later should take precedence over those specified +# earlier. + +. ./defs || Exit 1 + +set -e + +# We want (almost) complete control over automake options. +AUTOMAKE="$original_AUTOMAKE -Werror" + +cat > Makefile.am <<'END' +FOO := bar +AUTOMAKE_OPTIONS = +END + +set_warnings () +{ + 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 +} + +ok () +{ + $AUTOMAKE $* +} + +ko () +{ + AUTOMAKE_fails $* + grep '^Makefile\.am:1:.*:=.*not portable' stderr +} + +# Files required in gnu strictness. +touch README INSTALL NEWS AUTHORS ChangeLog COPYING + +$ACLOCAL +ok -Wportability -Wno-portability +ko -Wno-portability -Wportability + +set_warnings '' Makefile.am +set_warnings '-Wportability -Wno-portability' configure.in +rm -rf autom4te*.cache +$ACLOCAL +ok +set_warnings '-Wno-portability -Wportability' configure.in +rm -rf autom4te*.cache +$ACLOCAL +ko + +set_warnings '' configure.in +rm -rf autom4te*.cache +$ACLOCAL +set_warnings '-Wportability -Wno-portability' Makefile.am +ok +set_warnings '-Wno-portability -Wportability' Makefile.am +ko + +: -- 1.7.2.3