tests: work around strangeness in MSYS
[automake.git] / tests / amopts-location.test
blob23b75c0cacd72d40c1cc90bbc15f8984cdcfe80d
1 #! /bin/sh
2 # Copyright (C) 2011 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 errors about AUTOMAKE_OPTIONS refers to correct
18 # locations.
20 . ./defs || Exit 1
22 cat > Makefile.am <<'END'
23 # comment \
24 # continued
25 include Makefile0.am
26 END
28 cat > Makefile0.am <<'END'
32 include Makefile1.am
33 END
35 cat > Makefile1.am <<'END'
36 AUTOMAKE_OPTIONS = tar-pax
37 # comment
38 END
40 cat > Makefile2.am <<'END'
41 ## automake comment
42 bar:
44 line = \
45 continued
46 AUTOMAKE_OPTIONS = tar-ustar
47 END
49 cat > Makefile3.am <<'END'
50 quux = a
51 AUTOMAKE_OPTIONS =
52 quux += b
53 AUTOMAKE_OPTIONS += tar-v7
54 zardoz = 1
55 END
57 cat >>configure.in <<'END'
58 AC_CONFIG_FILES([Makefile2 Makefile3])
59 END
61 $ACLOCAL
62 # Automake options 'tar-v7', 'tar-ustar' and 'tar-pax' can only be used
63 # as argument to AM_INIT_AUTOMAKE, and not in AUTOMAKE_OPTIONS.
64 AUTOMAKE_fails
66 # Check that all the expected line numbers are correctly reported
67 # in automake warning/error messages.
68 grep '^Makefile1\.am:1:.*tar-pax' stderr
69 grep '^Makefile2\.am:6:.*tar-ustar' stderr
70 grep '^Makefile3\.am:2:.*tar-v7' stderr
71 grep '^Makefile\.am:3:.*Makefile0\.am.*included from here' stderr
72 grep '^Makefile0\.am:4:.*Makefile1\.am.*included from here' stderr
74 # And also check that no botched line number is reported.
75 cat stderr \
76 | grep -v '^Makefile\.am:3:' \
77 | grep -v '^Makefile0\.am:4:' \
78 | grep -v '^Makefile1\.am:1:' \
79 | grep -v '^Makefile2\.am:6:' \
80 | grep -v '^Makefile3\.am:2:' \
81 | grep . && Exit 1