+2010-06-20 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ Modernize, improve and extend tests `suffix*.test'.
+ * tests/suffix3.test: Enable `errexit' shell flag, and related
+ changes.
+ * tests/suffix4.test: Likewise.
+ * tests/suffix6.test: Likewise, and do not create a useless dummy
+ source file.
+ * tests/suffix7.test: Likewise.
+ * tests/suffix5.test: Enable `errexit' shell flag, and related
+ changes. Make grepping of Makefile.in slighty stricter.
+ * tests/suffix.test: Enable `errexit' shell flag, and related
+ changes. Also, do not redirect grep output to /dev/null, as this
+ might unmotivatedly hide useful information.
+ * tests/suffix2.test: Move setting of `errexit' shell flag earlier
+ in the script (just after inclusion of ./defs). Use a more
+ idiomatic way to count text occurrences in Makefile.in with
+ grep. Do not create useless dummy source files.
+ * tests/suffix10.test: Ensure verbose printing of captured make
+ stdout. Minor cosmetic changes.
+ * tests/suffix8.test: Likewise. Also, drop useless call to the
+ env(1) utility, and make grepping of make output stricter by using
+ $FGREP rather than plain grep.
+ * tests/suffix11.test: Likewise.
+ * tests/suffix12.test: Likewise.
+ * tests/suffix9.test: Prefet cat + here-doc over echo to append to
+ the `configure.in' stub. Cosmetic changes.
+ * tests/suffix13.test: Cosmetic spacing change.
+
2010-06-13 Stefano Lattarini <stefano.lattarini@gmail.com>
Add useful comment in test script ext.test.
#! /bin/sh
-# Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2001, 2002, 2010 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
. ./defs || Exit 1
+set -e
+
cat >> configure.in << 'END'
AC_PROG_CC
END
noinst_PROGRAMS = foo
END
-$ACLOCAL || Exit 1
-$AUTOMAKE -i || Exit 1
+$ACLOCAL
+
+$AUTOMAKE -i
+grep '^\.c\.o' Makefile.in
-grep '^\.c\.o' Makefile.in > /dev/null || Exit 1
+$AUTOMAKE
+grep '^\.c\.o' Makefile.in
-$AUTOMAKE || Exit 1
-grep '^\.c\.o' Makefile.in > /dev/null || Exit 1
+:
#! /bin/sh
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2010 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
$ACLOCAL
$AUTOCONF
$AUTOMAKE --add-missing
+
./configure
-$MAKE print >stdout
+
+$MAKE print >stdout || { cat stdout; Exit 1; }
cat stdout
grep 'BEGIN: foo.lo :END' stdout
+
+:
#! /bin/sh
-# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2010 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
.z_.c .w_.x_ :
cp $< $@
-
+.PHONY: print
print:
@echo BEGIN: $(foo_OBJECTS) :END
@echo BEGIN: $(bar_OBJECTS) :END
$ACLOCAL
$AUTOCONF
+
# What we do is not portable. Automake should warn.
AUTOMAKE_fails -a
-grep 'Inference rules can have only one target before the colon' stderr
+grep '[iI]nference rules can have only one target before the colon' stderr
+
# But this should work anyway.
$AUTOMAKE -a -Wno-portability
+
./configure
-env OBJEXT=foo $MAKE -e print >stdout
+
+OBJEXT=foo $MAKE -e print >stdout || { cat stdout; Exit 1; }
cat stdout
-grep 'BEGIN: foo.foo :END' stdout
-grep 'BEGIN: bar.foo :END' stdout
-grep 'BEGIN: baz1.foo baz2.foo :END' stdout
+$FGREP 'BEGIN: foo.foo :END' stdout
+$FGREP 'BEGIN: bar.foo :END' stdout
+$FGREP 'BEGIN: baz1.foo baz2.foo :END' stdout
+
+:
#! /bin/sh
-# Copyright (C) 2002, 2003, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2006, 2010 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
bin_PROGRAMS = foo
foo_SOURCES = foo.c sub/bar.baz
+
+.PHONY: print
print:
@echo BEGIN: $(foo_OBJECTS) :END
END
$AUTOCONF
$AUTOMAKE -a
./configure
-env OBJEXT=OBJ $MAKE -e print >stdout
+OBJEXT=OBJ $MAKE -e print >stdout || { cat stdout; Exit 1; }
cat stdout
-grep 'BEGIN: foo.OBJ sub/bar.OBJ :END' stdout
+$FGREP 'BEGIN: foo.OBJ sub/bar.OBJ :END' stdout
+
+:
#! /bin/sh
-# Copyright (C) 2002, 2003, 2006, 2009 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2006, 2009, 2010 Free Software Foundation,
+# Inc.
#
# This file is part of GNU Automake.
#
./configure
$MAKE
$MAKE distcheck
+
:
#! /bin/sh
-# Copyright (C) 1999, 2001, 2002, 2003 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2001, 2002, 2003, 2010 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
. ./defs || Exit 1
+set -e
+
cat >> configure.in << 'END'
AC_PROG_CC
AC_PROG_LIBTOOL
libltdl_la_SOURCES = ltdl.c ltdl.h
END
-: > ltdl.c
-: > ltdl.h
-
# Create all the files created libtoolize so we don't run libtoolize.
# We don't want the user to need libtool to run this test.
: > ltconfig
: > config.guess
: > config.sub
-set -e
-
-$ACLOCAL || Exit 1
+$ACLOCAL
$AUTOMAKE -a
-grep -c '^\.c\.o:' Makefile.in | grep '^1$'
-grep -c '^\.c\.obj:' Makefile.in | grep '^1$'
+test `grep -c '^\.c\.o:' Makefile.in` -eq 1
+test `grep -c '^\.c\.obj:' Makefile.in` -eq 1
-Exit 0
+:
#! /bin/sh
-# Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2001, 2002, 2010 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
. ./defs || Exit 1
+set -e
+
cat >> configure.in << 'END'
AC_PROG_CXX
END
foo_SOURCES = foo.zoo
END
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
# The foo.cc intermediate step is implicit, it's a mistake if
# Automake requires this file somewhere.
$FGREP foo.cc Makefile.in && Exit 1
# However Automake must figure that foo.zoo is eventually
# transformed into foo.o, and use this latter file (to link foo).
-$FGREP 'foo.$(OBJEXT)' Makefile.in || Exit 1
-Exit 0
+$FGREP 'foo.$(OBJEXT)' Makefile.in
+
+:
#! /bin/sh
-# Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2010 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
. ./defs || Exit 1
+set -e
+
cat > Makefile.am << 'END'
.k.o:
echo $< > $@
foo_SOURCES = foo.k
END
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
-grep '.SUFFIXES:.*\.k' Makefile.in || Exit 1
-Exit 0
+$ACLOCAL
+$AUTOMAKE
+grep '.SUFFIXES:.*\.k' Makefile.in
+
+:
#! /bin/sh
-# Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2010 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
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-required=libtool
-
# Test to make sure Automake include libtool objects resulting
# from user-defined implicit rules.
# Based on a report from Arkadiusz Miskiewicz <misiek@pld.ORG.PL>.
+required=libtool
. ./defs || Exit 1
+set -e
+
cat >> configure.in << 'END'
AC_PROG_LIBTOOL
END
: > config.guess
: > config.sub
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
-grep '_OBJECTS.*foo.lo' Makefile.in || Exit 1
-Exit 0
+$ACLOCAL
+$AUTOMAKE
+grep '_OBJECTS.*foo\.lo' Makefile.in
+
+:
#! /bin/sh
-# Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2010 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
. ./defs || Exit 1
+set -e
+
cat > Makefile.am << 'END'
SUFFIXES = a b .$(OBJEXT) c .o
bin_PROGRAMS = foo
cp $< $@
END
-: > fooa
-
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
# Automake must figure that fooa translates to foo.$(OBJEXT) and
# foo.$(OBJEXT) using the following rules:
# fooa --[ab]--> foob --[b.$(OBJEXT)]--> foo.$(OBJEXT)
-grep '_OBJECTS.* foo\.$(OBJEXT)' Makefile.in || Exit 1
+grep '_OBJECTS.* foo\.\$(OBJEXT)' Makefile.in
# fuc --[c.o]--> fu.$(OBJEXT) ## This is really meant !
-grep '_OBJECTS.* fu\.$(OBJEXT)' Makefile.in || Exit 1
+grep '_OBJECTS.* fu\.\$(OBJEXT)' Makefile.in
+
+:
#! /bin/sh
-# Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2010 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
. ./defs || Exit 1
+set -e
+
cat > Makefile.am << 'END'
SUFFIXES = .idl S.cpp C.h
SUFFIXES += C.cpp S.h
cp $< $@
END
-: > fooa
-
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
# Make sure Automake has NOT recognized .cpp and .idlC as two new
# extensions.
grep 'SUFFIXES.* \.cpp' Makefile.in && Exit 1
grep 'SUFFIXES.* \.idlC' Makefile.in && Exit 1
-Exit 0
+:
#! /bin/sh
-# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2010 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
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a
+
./configure
-env OBJEXT=foo $MAKE -e print >stdout
+
+OBJEXT=foo $MAKE -e print >stdout || { cat stdout; Exit 1; }
cat stdout
-grep 'BEGIN: foo.foo :END' stdout
-grep 'BEGIN: bar.lo :END' stdout
+$FGREP 'BEGIN: foo.foo :END' stdout
+$FGREP 'BEGIN: bar.lo :END' stdout
+
$MAKE test
+
+:
#! /bin/sh
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2010 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
set -e
-echo AC_PROG_CC >>configure.in
+cat >>configure.in << 'END'
+AC_PROG_CC
+END
+
+$ACLOCAL
# x_ -> y -> c -> o
# \________/
cp $< $@
END
-$ACLOCAL
$AUTOMAKE -a
# Idem with the rules the another order.
END
$AUTOMAKE -a
+
+: