From: Stefano Lattarini Date: Sun, 19 Dec 2010 23:46:21 +0000 (+0100) Subject: Add new tests on strictness and warnings precedence and overriding. X-Git-Tag: ng-0.5a~248^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b9ddbaa09383161fbf1a35de650abfc19f94f001;p=thirdparty%2Fautomake.git 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. --- diff --git a/ChangeLog b/ChangeLog index 1bf541284..665e16571 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2011-01-15 Stefano Lattarini + + 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-13 Ralf Wildenhues Avoid testsuite failures due to Autoconf Fortran change. diff --git a/tests/Makefile.am b/tests/Makefile.am index f23193828..4b6400b70 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 @@ -813,6 +813,8 @@ stdinc.test \ stamph2.test \ stdlib.test \ stdlib2.test \ +strictness-override.test \ +strictness-precedence.test \ strip.test \ strip2.test \ strip3.test \ @@ -942,6 +944,8 @@ vtexi.test \ vtexi2.test \ vtexi3.test \ vtexi4.test \ +warnings-override.test \ +warnings-precedence.test \ warnopts.test \ werror.test \ werror2.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index c2d2b8f5e..c15fc1244 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 @@ -1076,6 +1076,8 @@ stdinc.test \ stamph2.test \ stdlib.test \ stdlib2.test \ +strictness-override.test \ +strictness-precedence.test \ strip.test \ strip2.test \ strip3.test \ @@ -1205,6 +1207,8 @@ vtexi.test \ vtexi2.test \ vtexi3.test \ vtexi4.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 000000000..aacb5611c --- /dev/null +++ b/tests/strictness-override.test @@ -0,0 +1,123 @@ +#! /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 . + +# 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 + +# 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 000000000..a9492156f --- /dev/null +++ b/tests/strictness-precedence.test @@ -0,0 +1,77 @@ +#! /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 . + +# 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 + +# 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 000000000..728a7c034 --- /dev/null +++ b/tests/warnings-override.test @@ -0,0 +1,111 @@ +#! /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 . + +# 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 + +# 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 000000000..0f116695a --- /dev/null +++ b/tests/warnings-precedence.test @@ -0,0 +1,77 @@ +#! /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 . + +# 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 + +# 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 + +: