tests: work around strangeness in MSYS
[automake.git] / tests / acloca18.test
blobda9cbf5497fabc8d656b0b829bad04aa06e32ce3
1 #! /bin/sh
2 # Copyright (C) 2005, 2006, 2008, 2010, 2011 Free Software Foundation,
3 # Inc.
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2, or (at your option)
8 # any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 # Test for --install with #serial numbers.
20 am_create_testdir=empty
21 . ./defs || Exit 1
23 cat > configure.in << 'END'
24 AC_INIT
25 AM_MACRO1
26 AM_MACRO2
27 END
29 mkdir 1 2 3 4 5 6
31 cat >1/m1.m4 <<EOF
32 #serial 1.8.1230.9
33 AC_DEFUN([AM_MACRO1], [:macro11:])
34 AC_DEFUN([AM_MACRO2], [:macro21:])
35 EOF
37 cat >2/m1.m4 <<EOF
38 #serial 1.8.1231.9
39 AC_DEFUN([AM_MACRO1], [:macro12:])
40 EOF
42 cat >3/m2.m4 <<EOF
43 #serial 13
44 AC_DEFUN([AM_MACRO2], [:macro23:])
45 EOF
47 cat >3/m1.m4 <<EOF
48 #serial 1.8.1230.1
49 AC_DEFUN([AM_MACRO1], [:macro13:])
50 EOF
52 cat >4/mumble.m4 <<EOF
53 #serial 0
54 AC_DEFUN([AM_MACRO1], [:macro14:])
55 EOF
57 cat >5/ill-formed.m4 <<EOF
58 #serial bla
59 #serial .2
60 #serial
61 AC_DEFUN([AM_MACRO1], [:macro15:])
62 EOF
64 cat >6/after-def.m4 <<EOF
65 AC_DEFUN([AM_MACRO1], [:macro16:])
66 #serial 1
67 EOF
69 $ACLOCAL -I 1 -I 2 -I 3 -I 4
70 $AUTOCONF
71 $FGREP ':macro11:' configure
72 $FGREP ':macro21:' configure
74 rm -rf autom4te*.cache
75 $ACLOCAL -I 1 -I 2 -I 3 -I 4 --install
76 $AUTOCONF
77 $FGREP ':macro12:' configure
78 $FGREP ':macro23:' configure
80 rm -rf autom4te*.cache
81 $ACLOCAL -I 4 -I 1 -I 2 -I 3 --install --dry-run
82 $AUTOCONF
83 $FGREP ':macro12:' configure
84 $FGREP ':macro23:' configure
86 rm -rf autom4te*.cache
87 $ACLOCAL -I 4 -I 1 -I 2 -I 3 --install
88 $AUTOCONF
89 $FGREP ':macro14:' configure
90 $FGREP ':macro23:' configure
92 rm -rf autom4te*.cache
93 $ACLOCAL -I 4 -I 1 -I 2 --install 2>stderr && { cat stderr >&2; Exit 1; }
94 cat stderr >&2
95 grep 'macro.*AM_MACRO2.*not found' stderr
97 rm -rf autom4te*.cache
98 $ACLOCAL -I 4 -I 1 --install
99 $AUTOCONF
100 $FGREP ':macro14:' configure
101 $FGREP ':macro21:' configure
103 mkdir acdir
104 ACLOCAL="$ACLOCAL --system-acdir acdir"
106 rm -rf autom4te*.cache
107 cat >acdir/m1.m4 <<EOF
108 #serial 456
109 AC_DEFUN([AM_MACRO1], [:macro1d:])
110 AC_DEFUN([AM_MACRO2], [:macro2d:])
112 $ACLOCAL -I 4 -I 1 --diff=diff >stdout 2>stderr || {
113 cat stderr >&2
114 cat stdout
115 Exit 1
117 cat stderr >&2
118 cat stdout
119 grep '#serial 456' stdout
120 test ! -f 4/m1.m4
121 grep 'installing.*4/m1\.m4' stderr
123 $ACLOCAL -I 5 2>stderr && { cat stderr >&2; Exit 1; }
124 cat stderr >&2
125 test `grep -c 'ill-formed serial' stderr` -eq 3
127 $ACLOCAL -I 6 2>stderr && { cat stderr >&2; Exit 1; }
128 cat stderr >&2
129 grep 'serial.*before any macro definition' stderr