tests: fix spurious failure due to autom4te caching
[automake.git] / tests / acloca18.test
blobde997869a591de685f6a3d491430ac6fe162782b
1 #! /bin/sh
2 # Copyright (C) 2005, 2006, 2008, 2010 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 # Test for --install with #serial numbers.
19 . ./defs || Exit 1
21 set -e
23 cat >> configure.in << 'END'
24 AM_MACRO1
25 AM_MACRO2
26 END
28 mkdir 1 2 3 4
30 cat >1/m1.m4 <<EOF
31 #serial 1.8.1230.9
32 AC_DEFUN([AM_MACRO1], [echo macro11 >> foo])
33 AC_DEFUN([AM_MACRO2], [echo macro21 >> foo])
34 EOF
36 cat >2/m1.m4 <<EOF
37 #serial 1.8.1231.9
38 AC_DEFUN([AM_MACRO1], [echo macro12 >> foo])
39 EOF
41 cat >3/m2.m4 <<EOF
42 #serial 13
43 AC_DEFUN([AM_MACRO2], [echo macro23 >> foo])
44 EOF
46 cat >3/m1.m4 <<EOF
47 #serial 1.8.1230.1
48 AC_DEFUN([AM_MACRO1], [echo macro13 >> foo])
49 EOF
51 cat >4/mumble.m4 <<EOF
52 #serial 0
53 AC_DEFUN([AM_MACRO1], [echo macro14 >> foo])
54 EOF
56 $ACLOCAL -I 1 -I 2 -I 3 -I 4
57 $AUTOCONF
58 ./configure
59 grep macro11 foo
60 grep macro21 foo
62 rm -rf foo autom4te*.cache
63 $ACLOCAL -I 1 -I 2 -I 3 -I 4 --install
64 $AUTOCONF
65 ./configure
66 grep macro12 foo
67 grep macro23 foo
69 rm -rf foo autom4te*.cache
70 $ACLOCAL -I 4 -I 1 -I 2 -I 3 --install --dry-run
71 $AUTOCONF
72 ./configure
73 grep macro12 foo
74 grep macro23 foo
76 rm -rf foo autom4te*.cache
77 $ACLOCAL -I 4 -I 1 -I 2 -I 3 --install
78 $AUTOCONF
79 ./configure
80 grep macro14 foo
81 grep macro23 foo
83 rm -rf foo autom4te*.cache
84 $ACLOCAL -I 4 -I 1 -I 2 --install 2>stderr && { cat stderr >&2; Exit 1; }
85 cat stderr >&2
86 grep 'macro.*AM_MACRO2.*not found' stderr
88 rm -rf foo autom4te*.cache
89 $ACLOCAL -I 4 -I 1 --install
90 $AUTOCONF
91 ./configure
92 grep macro14 foo
93 grep macro21 foo
95 mkdir dirlist-test
96 cat >dirlist-test/m1.m4 <<EOF
97 #serial 456
98 AC_DEFUN([AM_MACRO1], [echo macro1d >> foo])
99 AC_DEFUN([AM_MACRO2], [echo macro2d >> foo])
101 rm -rf foo autom4te*.cache
102 $ACLOCAL -I 4 -I 1 --diff=diff >stdout 2>stderr || {
103 cat stderr >&2
104 cat stdout
105 Exit 1
107 cat stderr >&2
108 cat stdout
109 grep '#serial 456' stdout
110 test ! -f 4/m1.m4
111 grep 'installing.*4/m1\.m4' stderr