tests: avoid a spurious failure on MSYS
[platform/upstream/automake.git] / t / extra-portability3.sh
1 #! /bin/sh
2 # Copyright (C) 2011-2013 Free Software Foundation, Inc.
3 #
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.
8 #
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.
13 #
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/>.
16
17 # Check interactions between the 'portability-recursive' and
18 # 'extra-portability' warning categories.
19
20 . test-init.sh
21
22 # We want (almost) complete control over automake options.
23 AUTOMAKE="$am_original_AUTOMAKE --foreign -Werror"
24
25 cat >>configure.ac <<END
26 AC_PROG_CC
27 AC_PROG_RANLIB
28 AC_OUTPUT
29 END
30
31 $ACLOCAL
32
33 cat >Makefile.am <<'END'
34 baz = $(foo$(bar))
35 lib_LIBRARIES = libfoo.a
36 libfoo_a_SOURCES = foo.c
37 END
38
39 # 'extra-portability' implies 'portability-recursive'.
40 AUTOMAKE_fails -Wextra-portability
41 grep 'requires.*AM_PROG_AR' stderr
42 grep 'recursive variable expansion' stderr
43
44 # We can disable 'extra-portability' while leaving
45 # 'portability-recursive' intact.
46 AUTOMAKE_fails -Wportability-recursive -Wno-extra-portability
47 grep 'requires.*AM_PROG_AR' stderr && exit 1
48 grep 'recursive variable expansion' stderr
49
50 # We can disable 'portability-recursive' while leaving
51 # 'extra-portability' intact.
52 AUTOMAKE_fails -Wextra-portability -Wno-portability-recursive
53 grep 'requires.*AM_PROG_AR' stderr
54 grep 'recursive variable expansion' stderr && exit 1
55
56 # Disabling 'portability' disables 'portability-recursive' and
57 # 'extra-portability'.
58 $AUTOMAKE -Wextra-portability -Wno-portability
59
60 :