release: stable micro release 1.13.2
[automake.git] / t / warnings-win-over-strictness.sh
bloba037911be2abb25a1eeb9067ad5b611fbeaa8682
1 #! /bin/sh
2 # Copyright (C) 2011-2013 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 # Check that, on the command line, explicitly-defined warnings take
18 # precedence over implicit strictness-implied warnings.
20 . test-init.sh
22 # We want complete control over automake options.
23 AUTOMAKE=$am_original_AUTOMAKE
25 ok ()
27 AUTOMAKE_run $*
28 test ! -s stderr
31 ko ()
33 AUTOMAKE_run $*
34 grep '^Makefile\.am:.*:=.*not portable' stderr
35 test $(wc -l <stderr) -eq 1
38 set_am_opts()
40 set +x
41 sed <$2 >$2-t -e "s|^\\(AUTOMAKE_OPTIONS\\) *=.*|\\1 = $1|" \
42 -e "s|^\\(AM_INIT_AUTOMAKE\\).*|\\1([$1])|"
43 mv -f $2-t $2
44 set -x
45 cat $2
48 # Files required in gnu strictness.
49 touch README INSTALL NEWS AUTHORS ChangeLog COPYING
51 cat > Makefile.am <<END
52 AUTOMAKE_OPTIONS =
53 FOO := bar
54 END
56 $ACLOCAL
58 ko --foreign -Wportability
59 ko -Wportability --foreign
60 ok --gnu -Wno-portability
61 ok -Wno-portability --gnu
63 set_am_opts '' Makefile.am
65 rm -rf autom4te*.cache
66 set_am_opts 'foreign -Wportability' configure.ac
68 rm -rf autom4te*.cache
69 set_am_opts '-Wportability foreign' configure.ac
71 rm -rf autom4te*.cache
72 set_am_opts 'gnu -Wno-portability' configure.ac
74 rm -rf autom4te*.cache
75 set_am_opts '-Wno-portability gnu' configure.ac
78 rm -rf autom4te*.cache
79 set_am_opts '' configure.ac
81 set_am_opts 'foreign -Wportability' Makefile.am
83 set_am_opts '-Wportability foreign' Makefile.am
85 set_am_opts 'gnu -Wno-portability' Makefile.am
87 set_am_opts '-Wno-portability gnu' Makefile.am