Hash :
79103003
Author :
Date :
2011-01-08T19:40:04
tests: enable 'errexit' shell flag by default. * tests/defs: Enable `errexit' shell flag (near the end). Removed redundant comment about the enabling of shell traces. * tests/README (Writing test cases): Update, and use nicer formatting in a couple of places. * All tests: Adjusted by removing now-redundant calls to 'set -e'.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144
#! /bin/sh
# Copyright (C) 2005, 2006, 2008, 2010, 2011 Free Software Foundation,
# Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Test for --install with #serial numbers.
. ./defs || Exit 1
cat >> configure.in << 'END'
AM_MACRO1
AM_MACRO2
END
mkdir 1 2 3 4 5 6
cat >1/m1.m4 <<EOF
#serial 1.8.1230.9
AC_DEFUN([AM_MACRO1], [echo macro11 >> foo])
AC_DEFUN([AM_MACRO2], [echo macro21 >> foo])
EOF
cat >2/m1.m4 <<EOF
#serial 1.8.1231.9
AC_DEFUN([AM_MACRO1], [echo macro12 >> foo])
EOF
cat >3/m2.m4 <<EOF
#serial 13
AC_DEFUN([AM_MACRO2], [echo macro23 >> foo])
EOF
cat >3/m1.m4 <<EOF
#serial 1.8.1230.1
AC_DEFUN([AM_MACRO1], [echo macro13 >> foo])
EOF
cat >4/mumble.m4 <<EOF
#serial 0
AC_DEFUN([AM_MACRO1], [echo macro14 >> foo])
EOF
cat >5/ill-formed.m4 <<EOF
#serial bla
#serial .2
#serial
AC_DEFUN([AM_MACRO1], [echo macro15 >> foo])
EOF
cat >6/after-def.m4 <<EOF
AC_DEFUN([AM_MACRO1], [echo macro16 >> foo])
#serial 1
EOF
ACLOCAL_TESTSUITE_FLAGS='-I 1 -I 2 -I 3 -I 4'
$ACLOCAL
$AUTOCONF
./configure
grep macro11 foo
grep macro21 foo
$sleep
rm -f foo
$ACLOCAL --install
$AUTOCONF
./configure
grep macro12 foo
grep macro23 foo
$sleep
ACLOCAL_TESTSUITE_FLAGS='-I 4 -I 1 -I 2 -I 3'
rm -f foo
$ACLOCAL --install --dry-run
$AUTOCONF
./configure
grep macro12 foo
grep macro23 foo
$sleep
rm -f foo
$ACLOCAL --install
$AUTOCONF
./configure
grep macro14 foo
grep macro23 foo
$sleep
ACLOCAL_TESTSUITE_FLAGS='-I 4 -I 1 -I 2'
rm -f foo
$ACLOCAL --install 2>stderr && { cat stderr >&2; Exit 1; }
cat stderr >&2
grep 'macro.*AM_MACRO2.*not found' stderr
$sleep
ACLOCAL_TESTSUITE_FLAGS='-I 4 -I 1'
rm -f foo
$ACLOCAL --install
$AUTOCONF
./configure
grep macro14 foo
grep macro21 foo
$sleep
mkdir dirlist-test
cat >dirlist-test/m1.m4 <<EOF
#serial 456
AC_DEFUN([AM_MACRO1], [echo macro1d >> foo])
AC_DEFUN([AM_MACRO2], [echo macro2d >> foo])
EOF
rm -f foo
$ACLOCAL --diff=diff >stdout 2>stderr || {
cat stderr >&2
cat stdout
Exit 1
}
cat stderr >&2
cat stdout
grep '#serial 456' stdout
test ! -f 4/m1.m4
grep 'installing.*4/m1\.m4' stderr
$ACLOCAL -I 5 2>stderr && { cat stderr >&2; Exit 1; }
cat stderr >&2
test `grep -c 'ill-formed serial' stderr` -eq 3
$ACLOCAL -I 6 2>stderr && { cat stderr >&2; Exit 1; }
cat stderr >&2
grep 'serial.*before any macro definition' stderr
: