Merge branch 'yacc-quote-fix'
[automake.git] / tests / warnings-override.test
blob475a1bd9c9dcb59682cbc9e0e4e9f2b29f61348f
1 #! /bin/sh
2 # Copyright (C) 2011-2012 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
7 # any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 # The warnings specified in Makefile.am:AUTOMAKE_OPTIONS should override
18 # those specified in configure.in:AM_INIT_AUTOMAKE, and both should
19 # override the warnings specified on the command line.
20 # NOTE: the current semantics might not be the best one (even if it has
21 # been in place for quite a long time); see also Automake bug #7673.
22 # Update this test if the semantics are changed.
24 . ./defs || Exit 1
26 # We want (almost) complete control over automake options.
27 AUTOMAKE="$am_original_AUTOMAKE -Werror"
29 cat > Makefile.am <<'END'
30 FOO := bar
31 AUTOMAKE_OPTIONS =
32 END
34 set_warnings ()
36 set +x
37 sed <$2 >$2-t -e "s|^\\(AUTOMAKE_OPTIONS\\) *=.*|\\1 = $1|" \
38 -e "s|^\\(AM_INIT_AUTOMAKE\\).*|\\1([$1])|"
39 mv -f $2-t $2
40 set -x
41 cat $2
44 ok ()
46 $AUTOMAKE $*
49 ko ()
51 AUTOMAKE_fails $*
52 grep '^Makefile\.am:1:.*:=.*not portable' stderr
55 $ACLOCAL
57 # Files required in gnu strictness.
58 touch README INSTALL NEWS AUTHORS ChangeLog COPYING
60 rm -rf autom4te*.cache
61 set_warnings '-Wno-portability' Makefile.am
62 set_warnings '' configure.in
64 ok -Wportability
67 rm -rf autom4te*.cache
68 set_warnings '' Makefile.am
69 set_warnings '-Wno-portability' configure.in
71 ok -Wportability
74 rm -rf autom4te*.cache
75 set_warnings '-Wno-portability' Makefile.am
76 set_warnings '-Wno-portability' configure.in
78 ok -Wportability
80 rm -rf autom4te*.cache
81 set_warnings '-Wportability' Makefile.am
82 set_warnings '' configure.in
85 ko -Wno-portability
87 rm -rf autom4te*.cache
88 set_warnings '' Makefile.am
89 set_warnings '-Wportability' configure.in
92 ko -Wno-portability
94 rm -rf autom4te*.cache
95 set_warnings '-Wportability' Makefile.am
96 set_warnings '-Wportability' configure.in
97 ko -Wno-portability
99 rm -rf autom4te*.cache
100 set_warnings '-Wno-portability' Makefile.am
101 set_warnings '-Wportability' configure.in
103 ok -Wportability
105 rm -rf autom4te*.cache
106 set_warnings '-Wportability' Makefile.am
107 set_warnings '-Wno-portability' configure.in
109 ko -Wno-portability