2 # Copyright (C) 2005, 2006, 2008, 2010, 2011 Free Software Foundation,
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)
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
23 cat > configure.
in << 'END'
33 AC_DEFUN([AM_MACRO1], [:macro11:])
34 AC_DEFUN([AM_MACRO2], [:macro21:])
39 AC_DEFUN([AM_MACRO1], [:macro12:])
44 AC_DEFUN([AM_MACRO2], [:macro23:])
49 AC_DEFUN([AM_MACRO1], [:macro13:])
52 cat >4/mumble.
m4 <<EOF
54 AC_DEFUN([AM_MACRO1], [:macro14:])
57 cat >5/ill-formed.
m4 <<EOF
61 AC_DEFUN([AM_MACRO1], [:macro15:])
64 cat >6/after-def.
m4 <<EOF
65 AC_DEFUN([AM_MACRO1], [:macro16:])
69 $ACLOCAL -I 1 -I 2 -I 3 -I 4
71 $FGREP ':macro11:' configure
72 $FGREP ':macro21:' configure
74 rm -rf autom4te
*.cache
75 $ACLOCAL -I 1 -I 2 -I 3 -I 4 --install
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
83 $FGREP ':macro12:' configure
84 $FGREP ':macro23:' configure
86 rm -rf autom4te
*.cache
87 $ACLOCAL -I 4 -I 1 -I 2 -I 3 --install
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; }
95 grep 'macro.*AM_MACRO2.*not found' stderr
97 rm -rf autom4te
*.cache
98 $ACLOCAL -I 4 -I 1 --install
100 $FGREP ':macro14:' configure
101 $FGREP ':macro21:' configure
104 ACLOCAL
="$ACLOCAL --system-acdir acdir"
106 rm -rf autom4te
*.cache
107 cat >acdir
/m1.
m4 <<EOF
109 AC_DEFUN([AM_MACRO1], [:macro1d:])
110 AC_DEFUN([AM_MACRO2], [:macro2d:])
112 $ACLOCAL -I 4 -I 1 --diff=diff >stdout
2>stderr ||
{
119 grep '#serial 456' stdout
121 grep 'installing.*4/m1\.m4' stderr
123 $ACLOCAL -I 5 2>stderr
&& { cat stderr
>&2; Exit
1; }
125 test `grep -c 'ill-formed serial' stderr` -eq 3
127 $ACLOCAL -I 6 2>stderr
&& { cat stderr
>&2; Exit
1; }
129 grep 'serial.*before any macro definition' stderr