#! /bin/sh
# Copyright (C) 2005-2018 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 .
# Test for --install with #serial numbers.
am_create_testdir=empty
. test-init.sh
cat > configure.ac << 'END'
AC_INIT
AM_MACRO1
AM_MACRO2
END
mkdir 1 2 3 4 5 6
cat >1/m1.m4 <2/m1.m4 <3/m2.m4 <3/m1.m4 <4/mumble.m4 <5/ill-formed.m4 <6/after-def.m4 <stderr && { cat stderr >&2; exit 1; }
cat stderr >&2
grep 'macro.*AM_MACRO2.*not found' stderr
clean_stale
$ACLOCAL -I 4 -I 1 --install
$AUTOCONF
$FGREP ':macro14:' configure
$FGREP ':macro21:' configure
mkdir acdir
ACLOCAL="$ACLOCAL --system-acdir acdir"
cat >acdir/m1.m4 <stdout 2>stderr || {
cat stderr >&2
cat stdout
exit 1
}
cat stderr >&2
cat stdout
grep '#serial 456' stdout
test ! -e 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
: