Merge branch 'maint'
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 27 Oct 2012 14:15:04 +0000 (16:15 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 27 Oct 2012 14:15:04 +0000 (16:15 +0200)
* maint:
  tests: merge, tweak and modernize few test scripts
  tests: move coverage about BUILT_SOURCES
  tests: more meaningful names for some test cases
  tests: merge some grepping tests on Yacc support

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
29 files changed:
t/am-default-source-ext.sh [moved from t/specflg10.sh with 100% similarity]
t/built-sources-check.sh [moved from t/check3.sh with 77% similarity]
t/built-sources-cond.sh [new file with mode: 0755]
t/built-sources-fork-bomb.sh [new file with mode: 0755]
t/built-sources-install.sh [new file with mode: 0755]
t/built-sources-subdir.sh [moved from t/subdirbuiltsources.sh with 76% similarity]
t/built-sources.sh [new file with mode: 0755]
t/cxxcpp.sh
t/cxxo.sh [deleted file]
t/empty-data-primary.sh [moved from t/empty.sh with 100% similarity]
t/empty-sources-primary.tap [moved from t/empty4.sh with 63% similarity]
t/empty2.sh [deleted file]
t/empty3.sh [deleted file]
t/fo.sh [deleted file]
t/list-of-tests.mk
t/no-outdir-option.sh [deleted file]
t/no-spurious-install-recursive.sh [moved from t/bsource.sh with 100% similarity]
t/per-target-flags.sh [new file with mode: 0755]
t/specflg.sh [deleted file]
t/specflg2.sh [deleted file]
t/specflg3.sh [deleted file]
t/subdir-env-interference.sh [moved from t/subdir10.sh with 100% similarity]
t/suffix-custom-subobj-and-specflg.sh [moved from t/suffix13.sh with 100% similarity]
t/suffix-custom-subobj.sh [moved from t/suffix12.sh with 100% similarity]
t/yacc-grepping.sh [moved from t/yacc2.sh with 80% similarity]
t/yacc-grepping2.sh [moved from t/yacc5.sh with 100% similarity]
t/yacc-headers-and-dist-pr47.sh [moved from t/yacc7.sh with 100% similarity]
t/yacc-subdir.sh [moved from t/yacc8.sh with 100% similarity]
t/yacc.sh [deleted file]

similarity index 100%
rename from t/specflg10.sh
rename to t/am-default-source-ext.sh
similarity index 77%
rename from t/check3.sh
rename to t/built-sources-check.sh
index 3e4ce96..d4d3c51 100755 (executable)
@@ -14,7 +14,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Make sure 'check:' and 'install:' honor $(BUILT_SOURCES).
+# Make sure 'check:' honors $(BUILT_SOURCES).
 # PR/359.
 
 # For gen-testsuite-part: ==> try-with-serial-tests <==
@@ -63,18 +63,6 @@ cat stdout
 grep '^PASS: subrun\.sh *$' stdout
 grep 'PASS.*echo\.sh' stdout && exit 1
 
-# check should depend directly on $(BUILT_SOURCES) (similar tests
-# are in check.sh and check2.sh).
-$EGREP '^check:.* \$\(BUILT_SOURCES\)( |$)' Makefile.in
-$EGREP '^check:.* \$\(BUILT_SOURCES\)( |$)' dir/Makefile.in
-
-$MAKE clean
-# Sanity checks
-test ! -e command1.inc
-test ! -e dir/command2.inc
-# Now make sure these two files are rebuilt during make install.
-$MAKE install
-test -f command1.inc
-test -f dir/command2.inc
+$MAKE distcheck
 
 :
diff --git a/t/built-sources-cond.sh b/t/built-sources-cond.sh
new file mode 100755 (executable)
index 0000000..ac78a97
--- /dev/null
@@ -0,0 +1,91 @@
+#! /bin/sh
+# Copyright (C) 2003-2012 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/>.
+
+# Interaction of BUILT_SOURCES with conditionals.
+
+. ./defs || exit 1
+
+cat >> configure.ac <<'END'
+AM_CONDITIONAL([COND1], [test $cond1 = yes])
+AM_CONDITIONAL([COND2], [test $cond2 = yes])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+if COND1
+BUILT_SOURCES = a
+else
+BUILT_SOURCES = b
+endif
+if COND2
+BUILT_SOURCES += c
+endif
+
+a b c:
+       echo who cares > $@
+END
+
+$ACLOCAL
+$AUTOMAKE
+$AUTOCONF
+
+cleanup ()
+{
+  # Files in $(BUILT_SOURCES) should be automatically removed
+  # upon maintainer-clean.
+  $MAKE maintainer-clean
+  test ! -f a
+  test ! -f b
+  test ! -f c
+}
+
+./configure cond1=yes cond2=yes
+
+$MAKE
+test -f a
+test ! -f b
+test -f c
+
+cleanup
+
+./configure cond1=no cond2=yes
+
+$MAKE
+test ! -f a
+test -f b
+test -f c
+
+cleanup
+
+./configure cond1=yes cond2=no
+
+$MAKE
+test -f a
+test ! -f b
+test ! -f c
+
+cleanup
+
+./configure cond1=no cond2=no
+
+$MAKE
+test ! -f a
+test -f b
+test ! -f c
+
+cleanup
+
+:
diff --git a/t/built-sources-fork-bomb.sh b/t/built-sources-fork-bomb.sh
new file mode 100755 (executable)
index 0000000..fac3750
--- /dev/null
@@ -0,0 +1,70 @@
+#! /bin/sh
+# Copyright (C) 2012 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/>.
+
+# Due to how the handling of $(BUILT_SOURCES) is implemented in Automake-NG,
+# a recursive make call in the recipe of any $(BUILT_SOURCES) (or of any of
+# its prerequisites) might cause an infinite recursion (complete with fork
+# bomb, yuck) if not handled correctly.  Verify that this doesn't happen.
+# For more background, see:
+# <http://lists.gnu.org/archive/html/help-smalltalk/2012-08/msg00027.html>
+# <http://lists.gnu.org/archive/html/automake-patches/2012-08/msg00052.html>
+# Backported to improve coverage of mainline Automake.
+
+required=GNUmake
+. ./defs || exit 1
+
+echo AC_OUTPUT >> configure.ac
+
+cat > Makefile.am << 'END'
+BUILT_SOURCES = foo
+.PHONY: build-foo
+build-foo:
+       echo OK > foo
+foo:
+       $(MAKE) build-foo
+
+# If the bug is still present, we want this test to fail, not to actually
+# go fork bomb and potentially crash the user machine.  Take care of that.
+
+is_too_deep := $(shell test $(MAKELEVEL) -lt 10 && echo no)
+
+## Extra indentation here required to avoid confusing Automake.
+ ifeq ($(is_too_deep),no)
+   # All is ok.
+ else
+   $(error ::OOPS:: Recursion too deep, $(MAKELEVEL) levels)
+ endif
+END
+
+$ACLOCAL
+$AUTOMAKE -Wno-portability
+$AUTOCONF
+
+./configure
+
+$MAKE -n foo >output 2>&1 || { cat output; exit 1; }
+cat output
+test ! -f foo
+# Guard against possible infinite recursion.
+$FGREP '::OOPS::' output && exit 1
+
+$MAKE foo >output 2>&1 || { cat output; exit 1; }
+cat output
+$MAKE foo
+# Guard against possible infinite recursion.
+$FGREP '::OOPS::' output && exit 1
+
+:
diff --git a/t/built-sources-install.sh b/t/built-sources-install.sh
new file mode 100755 (executable)
index 0000000..2f53bb5
--- /dev/null
@@ -0,0 +1,69 @@
+#! /bin/sh
+# Copyright (C) 2002-2012 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/>.
+
+# Make sure 'install:' honors $(BUILT_SOURCES).
+# PR/359.
+
+. ./defs || exit 1
+
+cat >> configure.ac << 'END'
+AC_CONFIG_FILES([dir/Makefile])
+AC_OUTPUT
+END
+
+mkdir dir
+
+cat > Makefile.am << 'END'
+BUILT_SOURCES = built1
+SUBDIRS = dir
+built1:
+       echo ok > $@
+CLEANFILES = built1
+install-data-hook:
+       $(MKDIR_P) $(DESTDIR)$(prefix)/dir2
+       cp built1 $(DESTDIR)$(prefix)/built1
+       cp dir/built2 $(DESTDIR)$(prefix)/dir2/built3
+uninstall-hook:
+       rm -f $(DESTDIR)$(prefix)/built1
+       rm -f $(DESTDIR)$(prefix)/dir2/built3
+       rmdir $(DESTDIR)$(prefix)/dir2
+installcheck-local:
+       test -f $(prefix)/built1
+       test -f $(prefix)/dir2/built3
+END
+
+cat > dir/Makefile.am << 'END'
+BUILT_SOURCES = built2
+built2:
+## The next line ensures that command1.inc has been built before
+## recurring into the subdir.
+       cp ../built1 $@
+CLEANFILES = built2
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+./configure --prefix "$(pwd)/inst"
+
+# Now make sure these two files are rebuilt during make install.
+$MAKE install
+test -f built1
+test -f dir/built2
+$MAKE installcheck
+$MAKE distcheck
+
+:
similarity index 76%
rename from t/subdirbuiltsources.sh
rename to t/built-sources-subdir.sh
index 84f65a6..cc162bb 100755 (executable)
@@ -14,7 +14,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Make sure when using SUBDIR that all BUILT_SOURCES are built.
+# Make sure when using SUBDIRS that all BUILT_SOURCES are built.
 # A bug occurred where subdirs do not have all-recursive or
 # all-recursive-am which depended on BUILT_SOURCES.
 
@@ -31,14 +31,6 @@ AM_PROG_AR
 AC_OUTPUT
 END
 
-# Files required because we are using '--gnu'.
-: > INSTALL
-: > NEWS
-: > README
-: > COPYING
-: > AUTHORS
-: > ChangeLog
-
 cat > Makefile.am << 'END'
 SUBDIRS = lib
 END
@@ -47,25 +39,24 @@ cat > lib/Makefile.am << 'END'
 pkgdata_DATA =
 noinst_LIBRARIES = libfoo.a
 libfoo_a_SOURCES = foo.c
-BUILT_SOURCES=foo.h
+BUILT_SOURCES = foo.h
 foo.h:
        echo \#define FOO_DEFINE 1 >$@
+CLEANFILES = $(BUILT_SOURCES)
 END
 
 cat > lib/foo.c << 'END'
 #include <foo.h>
-int foo () { return !FOO_DEFINE;}
+int foo (void) { return !FOO_DEFINE; }
 END
 
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE --include-deps --copy --force-missing --add-missing --gnu
+$AUTOMAKE --copy --add-missing
 
 ./configure
-
-# Remove the comment to get a successful test.
-# $MAKE -C lib foo.h
 $MAKE
+$MAKE distcheck
 
 :
diff --git a/t/built-sources.sh b/t/built-sources.sh
new file mode 100755 (executable)
index 0000000..5173136
--- /dev/null
@@ -0,0 +1,68 @@
+#! /bin/sh
+# Copyright (C) 2003-2012 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/>.
+
+# Basic test on BUILT_SOURCES.
+
+required=cc
+. ./defs || exit 1
+
+cat >> configure.ac <<'END'
+AC_PROG_CC
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+BUILT_SOURCES = foo.c
+noinst_PROGRAMS = bar baz
+foo.c:
+       rm -f $@ $@-t
+## Use printf, not echo, to avoid spurious interpretation of
+## the "\n" as a newline (seen on NetBSD 5.1).
+       printf '%s\n' '#include <stdio.h>'               >  $@-t
+       printf '%s\n' 'int main (void)'                  >> $@-t
+       printf '%s\n' '{               '                 >> $@-t
+       printf '%s\n' '  printf ("%s\n", FOOMSG);'       >> $@-t
+       printf '%s\n' '  return 0;'                      >> $@-t
+       printf '%s\n' '}'                                >> $@-t
+       mv -f $@-t $@
+CLEANFILES = foo.c
+END
+
+cat > bar.c <<'END'
+#define FOOMSG "Howdy, World"
+#include "foo.c"
+END
+
+cat > baz.c <<'END'
+#define FOOMSG "Hello, Earth"
+#include "foo.c"
+END
+
+$ACLOCAL
+$AUTOMAKE
+$AUTOCONF
+
+./configure
+$MAKE
+if cross_compiling; then :; else
+  ./bar
+  ./bar | grep 'Howdy, World'
+  ./baz
+  ./baz | grep 'Hello, Earth'
+fi
+$MAKE distcheck
+
+:
index f2bb75a..cd5d392 100755 (executable)
@@ -27,4 +27,6 @@ END
 $ACLOCAL
 $AUTOMAKE
 
-grep '^CXXCPP' Makefile.in
+grep '^CXXCPP =' Makefile.in
+
+:
diff --git a/t/cxxo.sh b/t/cxxo.sh
deleted file mode 100755 (executable)
index 4a02131..0000000
--- a/t/cxxo.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#! /bin/sh
-# Copyright (C) 1996-2012 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/>.
-
-# Make sure C++ files are rewritten to ".o" and not just "o".
-. ./defs || exit 1
-
-cat >> configure.ac << 'END'
-AC_PROG_CXX
-END
-
-cat > Makefile.am << 'END'
-sbin_PROGRAMS = anonymous
-anonymous_SOURCES = doe.C
-END
-
-: > doe.C
-
-$ACLOCAL
-$AUTOMAKE
-
-$FGREP 'doe.$(OBJEXT)' Makefile.in
similarity index 100%
rename from t/empty.sh
rename to t/empty-data-primary.sh
similarity index 63%
rename from t/empty4.sh
rename to t/empty-sources-primary.tap
index 1233f40..3e5b3f4 100755 (executable)
 # 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 to make sure empty _SOURCES works.
-# From Paul Berrevoets.
+# A test for missing _SOURCES variable.  Also test to make sure empty
+# _SOURCES suppresses assumption about default name.
 
 . ./defs || exit 1
 
+plan_ 5
+
 cat >> configure.ac << 'END'
 AC_PROG_CC
-AC_SUBST(ZOO_OBJ)
+AC_SUBST([zoo_obj])
 END
 
 cat > Makefile.am << 'END'
+sbin_PROGRAMS = pavel
+
+bin_PROGRAMS = pavel2
+pavel2_SOURCES =
+
 noinst_PROGRAMS = zoo
 zoo_SOURCES =
 EXTRA_zoo_SOURCES = bar.c foo.c
-zoo_DEPENDENCIES = $(ZOO_OBJ)
+zoo_DEPENDENCIES = $(zoo_obj)
 zoo_LDADD = $(zoo_DEPENDENCIES)
 END
 
-$ACLOCAL
-$AUTOMAKE
-$FGREP zoo. Makefile.in && exit 1
-exit 0
+command_ok_ "aclocal" $ACLOCAL
+command_ok_ "automake" $AUTOMAKE
+
+command_ok_ "default _SOURCES" $FGREP ' pavel.c' Makefile.in
+command_ok_ "empty _SOURCES (basic)" not $FGREP 'pavel2.' Makefile.in
+command_ok_ "empty _SOURCES (elaborate)" not $FGREP 'zoo.' Makefile.in
+
+:
diff --git a/t/empty2.sh b/t/empty2.sh
deleted file mode 100755 (executable)
index 47a0792..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-#! /bin/sh
-# Copyright (C) 1999-2012 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 to make sure empty _SOURCES suppresses assumption about default
-# name.  Report from Pavel Roskin.
-
-. ./defs || exit 1
-
-cat >> configure.ac << 'END'
-AC_PROG_CC
-END
-
-cat > Makefile.am << 'END'
-bin_PROGRAMS = pavel
-pavel_SOURCES =
-END
-
-$ACLOCAL
-$AUTOMAKE
-
-grep 'pavel\.[co]' Makefile.in && exit 1
-exit 0
diff --git a/t/empty3.sh b/t/empty3.sh
deleted file mode 100755 (executable)
index f77f439..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-#! /bin/sh
-# Copyright (C) 1999-2012 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/>.
-
-# A test for missing _SOURCES variable.
-
-. ./defs || exit 1
-
-cat >> configure.ac << 'END'
-AC_PROG_CC
-END
-
-cat > Makefile.am << 'END'
-bin_PROGRAMS = pavel
-END
-
-$ACLOCAL
-$AUTOMAKE
-
-grep 'pavel\.[co]' Makefile.in
diff --git a/t/fo.sh b/t/fo.sh
deleted file mode 100755 (executable)
index 4ca1a05..0000000
--- a/t/fo.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#! /bin/sh
-# Copyright (C) 1998-2012 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/>.
-
-# Make sure Fortran 77 files are rewritten to ".o" and not just "o".
-# Matthew D. Langston <langston@SLAC.Stanford.EDU>
-
-. ./defs || exit 1
-
-cat >> configure.ac << 'END'
-AC_PROG_F77
-END
-
-cat > Makefile.am << 'END'
-sbin_PROGRAMS = anonymous
-anonymous_SOURCES = doe.f
-END
-
-: > doe.f
-
-$ACLOCAL
-$AUTOMAKE
-
-$FGREP 'doe.$(OBJEXT)' Makefile.in
index 425e545..6d01646 100644 (file)
@@ -131,6 +131,7 @@ t/amopt.sh \
 t/amopts-location.sh \
 t/amopts-variable-expansion.sh \
 t/amsubst.sh \
+t/am-default-source-ext.sh \
 t/ansi2knr-no-more.sh \
 t/ar-lib.sh \
 t/ar-lib2.sh \
@@ -186,7 +187,12 @@ t/badline.sh \
 t/badopt.sh \
 t/badprog.sh \
 t/block.sh \
-t/bsource.sh \
+t/built-sources-check.sh \
+t/built-sources-cond.sh \
+t/built-sources-fork-bomb.sh \
+t/built-sources-install.sh \
+t/built-sources-subdir.sh \
+t/built-sources.sh \
 t/candist.sh \
 t/canon.sh \
 t/canon2.sh \
@@ -202,7 +208,6 @@ t/ccnoco2.sh \
 t/ccnoco3.sh \
 t/check.sh \
 t/check2.sh \
-t/check3.sh \
 t/check4.sh \
 t/check5.sh \
 t/check6.sh \
@@ -338,7 +343,6 @@ t/cxx-lt-demo.sh \
 t/cxxlibobj.sh \
 t/cxxlink.sh \
 t/cxxnoc.sh \
-t/cxxo.sh \
 t/cygnus-no-more.sh \
 t/cygwin32.sh \
 t/dash.sh \
@@ -419,10 +423,8 @@ t/dollarvar2.sh \
 t/double.sh \
 t/dup2.sh \
 t/else.sh \
-t/empty.sh \
-t/empty2.sh \
-t/empty3.sh \
-t/empty4.sh \
+t/empty-data-primary.sh \
+t/empty-sources-primary.tap \
 t/exdir.sh \
 t/exdir2.sh \
 t/exdir3.sh \
@@ -458,7 +460,6 @@ t/flibs.sh \
 t/fn99.sh \
 t/fn99subdir.sh \
 t/fnoc.sh \
-t/fo.sh \
 t/forcemiss.sh \
 t/forcemiss2.sh \
 t/fort1.sh \
@@ -690,7 +691,7 @@ t/mkinst3.sh \
 t/mmode.sh \
 t/mmodely.sh \
 t/no-extra-makefile-code.sh \
-t/no-outdir-option.sh \
+t/no-spurious-install-recursive.sh \
 t/nobase.sh \
 t/nobase-libtool.sh \
 t/nobase-python.sh \
@@ -818,6 +819,7 @@ t/test-extensions-cond.sh \
 t/parse.sh \
 t/percent.sh \
 t/percent2.sh \
+t/per-target-flags.sh \
 t/phony.sh \
 t/pluseq.sh \
 t/pluseq2.sh \
@@ -986,14 +988,10 @@ t/silent-yacc-headers.sh \
 t/src-acsubst.sh \
 t/sourcefile-in-subdir.sh \
 t/space.sh \
-t/specflg.sh \
-t/specflg2.sh \
-t/specflg3.sh \
 t/specflg6.sh \
 t/specflg7.sh \
 t/specflg8.sh \
 t/specflg9.sh \
-t/specflg10.sh \
 t/specflg-dummy.sh \
 t/spell.sh \
 t/spell2.sh \
@@ -1017,12 +1015,11 @@ t/subdir-add2-pr46.sh \
 t/subdir-am-cond.sh \
 t/subdir-cond-err.sh \
 t/subdir-cond-gettext.sh \
+t/subdir-env-interference.sh \
 t/subdir-order.sh \
 t/subdir-with-slash.sh \
 t/subdir-subsub.sh \
-t/subdir10.sh \
 t/subdir-distclean.sh \
-t/subdirbuiltsources.sh \
 t/subobj.sh \
 t/subobj2.sh \
 t/subobj4.sh \
@@ -1064,9 +1061,9 @@ t/suffix8.tap \
 t/suffix9.sh \
 t/suffix10.tap \
 t/suffix11.tap \
-t/suffix12.sh \
-t/suffix13.sh \
 t/suffix-chain.tap \
+t/suffix-custom-subobj.sh \
+t/suffix-custom-subobj-and-specflg.sh \
 t/symlink.sh \
 t/symlink2.sh \
 t/syntax.sh \
@@ -1244,12 +1241,7 @@ t/werror3.sh \
 t/werror4.sh \
 t/whoami.sh \
 t/xsource.sh \
-t/yacc.sh \
-t/yacc2.sh \
 t/yacc4.sh \
-t/yacc5.sh \
-t/yacc7.sh \
-t/yacc8.sh \
 t/yaccdry.sh \
 t/yaccpp.sh \
 t/yaccvpath.sh \
@@ -1268,10 +1260,14 @@ t/yacc-depend.sh \
 t/yacc-depend2.sh \
 t/yacc-dist-nobuild-subdir.sh \
 t/yacc-dist-nobuild.sh \
+t/yacc-grepping.sh \
+t/yacc-grepping2.sh \
+t/yacc-headers-and-dist-pr47.sh \
 t/yacc-line.sh \
 t/yacc-mix-c-cxx.sh \
 t/yacc-nodist.sh \
 t/yacc-pr204.sh \
+t/yacc-subdir.sh \
 t/yacc-weirdnames.sh \
 t/yflags.sh \
 t/yflags2.sh \
diff --git a/t/no-outdir-option.sh b/t/no-outdir-option.sh
deleted file mode 100755 (executable)
index 59987b5..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2010-2012 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/>.
-
-# Check that the '-o' aka '--output-dir' option is not recognized anymore.
-
-. ./defs || exit 1
-
-: > Makefile.am
-
-AUTOMAKE_fails -Wno-error --output-dir=foo
-grep 'unrecognized option.*--output-dir' stderr
-
-AUTOMAKE_fails -Wno-error -o foo
-grep 'unrecognized option.*-o' stderr
-
-:
diff --git a/t/per-target-flags.sh b/t/per-target-flags.sh
new file mode 100755 (executable)
index 0000000..e5278fb
--- /dev/null
@@ -0,0 +1,100 @@
+#! /bin/sh
+# Copyright (C) 1999-2012 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 executable-specific and library-specific flags, both with
+# and without dependency tracking.
+
+. ./defs || Exit 1
+
+makefiles='Makefile libMakefile Makefile2 libMakefile2'
+
+cat > configure.ac << END
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE([-Wno-extra-portability])
+AC_CONFIG_FILES([$makefiles])
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_PROG_CXX
+AC_PROG_RANLIB
+AC_OUTPUT
+END
+
+$ACLOCAL
+
+cat > Makefile.am << 'END'
+bin_PROGRAMS = foo
+foo_SOURCES = foo.c
+foo_CFLAGS = -DBAR
+END
+
+cat > libMakefile.am << 'END'
+lib_LIBRARIES = libfoo.a
+libfoo_a_SOURCES = foo.c bar.cc
+libfoo_a_CFLAGS = -DBAR
+libfoo_a_CXXFLAGS = -DZOT
+END
+
+cat - Makefile.am > Makefile2.am << 'END'
+AUTOMAKE_OPTIONS = no-dependencies
+END
+
+cat - libMakefile.am > libMakefile2.am << 'END'
+AUTOMAKE_OPTIONS = no-dependencies
+END
+
+# Make sure 'compile' is required.
+for m in $makefiles; do
+  AUTOMAKE_fails $m
+  $EGREP " required file.* '(compile|\./compile)'" stderr
+done
+
+makefiles=$(for mkf in $makefiles; do echo $mkf.in; done)
+
+: > compile
+$AUTOMAKE
+
+# Sanity check.
+for mkf in $makefiles; do test -f $mkf || exit 99; done
+
+# Regression test for missing space.
+$FGREP ')-c' $makefiles && exit 1
+
+# Regression test for botchedly transformed object names.
+$FGREP '.o.o' $makefiles && exit 1
+$FGREP '.obj.obj' $makefiles && exit 1
+$FGREP '.$(OBJEXT).$(OBJEXT)' $makefiles && exit 1
+
+# Watch against non-transformed "foo.$(OBJEXT)", "foo.o" and "foo.obj"
+# (and similarly for bar).
+$EGREP '[^-](foo|bar)\.[o$]' $makefiles && exit 1
+
+# All our programs and libraries have per-target flags, so all
+# the compilers invocations must use an explicit '-c' option.
+grep '\$.COMPILE' $makefiles | grep -v ' -c' && exit 1
+
+$FGREP 'foo-foo.$(OBJEXT)' Makefile.in
+$FGREP 'foo-foo.$(OBJEXT)' Makefile2.in
+$FGREP 'libfoo_a-foo.$(OBJEXT)' libMakefile.in
+$FGREP 'libfoo_a-foo.$(OBJEXT)' libMakefile2.in
+$FGREP 'libfoo_a-bar.$(OBJEXT)' libMakefile.in
+$FGREP 'libfoo_a-bar.$(OBJEXT)' libMakefile2.in
+
+$FGREP '$(foo_CFLAGS)' Makefile.in
+$FGREP '$(foo_CFLAGS)' Makefile2.in
+$FGREP '$(libfoo_a_CFLAGS)' libMakefile.in
+$FGREP '$(libfoo_a_CFLAGS)' libMakefile2.in
+
+:
diff --git a/t/specflg.sh b/t/specflg.sh
deleted file mode 100755 (executable)
index c56c6aa..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-#! /bin/sh
-# Copyright (C) 1999-2012 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 of flags specific to executable.
-
-. ./defs || exit 1
-
-cat >> configure.ac << 'END'
-AC_PROG_CC
-AM_PROG_CC_C_O
-END
-
-cat > Makefile.am << 'END'
-AUTOMAKE_OPTIONS = no-dependencies
-bin_PROGRAMS = foo
-foo_SOURCES = foo.c
-foo_CFLAGS = -DBAR
-END
-
-# Make sure 'compile' is required.
-$ACLOCAL
-AUTOMAKE_fails
-grep 'required.*compile' stderr
-
-: > compile
-
-$AUTOMAKE
-
-# Look for $(COMPILE) -c in .c.o rule.
-grep 'COMPILE. [^-]' Makefile.in && exit 1
-
-# Look for foo-foo.o.
-grep '[^-]foo\.o' Makefile.in && exit 1
-
-# Regression test for missing space.
-$FGREP ')-c' Makefile.in && exit 1
-
-exit 0
diff --git a/t/specflg2.sh b/t/specflg2.sh
deleted file mode 100755 (executable)
index 4560715..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-#! /bin/sh
-# Copyright (C) 1999-2012 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 library-specific flags.
-
-. ./defs || exit 1
-
-cat >> configure.ac << 'END'
-AC_PROG_CC
-AM_PROG_CC_C_O
-AC_PROG_CXX
-AM_PROG_AR
-AC_PROG_RANLIB
-END
-
-cat > Makefile.am << 'END'
-AUTOMAKE_OPTIONS = no-dependencies
-lib_LIBRARIES = libfoo.a
-libfoo_a_SOURCES = foo.c bar.cc
-libfoo_a_CFLAGS = -DBAR
-libfoo_a_CXXFLAGS = -DZOT
-END
-
-: > ar-lib
-
-# Make sure 'compile' is required.
-$ACLOCAL
-AUTOMAKE_fails
-grep 'required.*compile' stderr
-
-: > compile
-
-$AUTOMAKE
-
-# Look for $(COMPILE) -c in .c.o rule.
-grep 'COMPILE. [^-]' Makefile.in && exit 1
-
-# Look for libfoo_a-foo.o.
-grep foo Makefile.in
-grep '[^-]foo\.o' Makefile.in && exit 1
-
-# Look for libfoo_a-bar.o.
-grep bar Makefile.in
-grep '[^-]bar\.o' Makefile.in && exit 1
-
-exit 0
diff --git a/t/specflg3.sh b/t/specflg3.sh
deleted file mode 100755 (executable)
index 9c56aca..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-#! /bin/sh
-# Copyright (C) 1999-2012 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 exe-specific flags with dependency tracking.
-
-. ./defs || exit 1
-
-cat >> configure.ac << 'END'
-AC_PROG_CC
-AM_PROG_CC_C_O
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-bin_PROGRAMS = foo
-foo_SOURCES = foo.c
-foo_CFLAGS = -DFOO
-END
-
-: > compile
-
-$ACLOCAL
-$AUTOMAKE
-
-$FGREP ' -o foo-foo' Makefile.in
-$FGREP 'foo.o.o' Makefile.in && exit 1
-$FGREP 'foo.$(OBJEXT).$(OBJEXT)' Makefile.in && exit 1
-$FGREP '$(foo_CFLAGS)' Makefile.in
-
-:
similarity index 100%
rename from t/subdir10.sh
rename to t/subdir-env-interference.sh
similarity index 100%
rename from t/suffix12.sh
rename to t/suffix-custom-subobj.sh
similarity index 80%
rename from t/yacc2.sh
rename to t/yacc-grepping.sh
index 64e5421..19036c4 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1999-2012 Free Software Foundation, Inc.
+# Copyright (C) 1996-2012 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/>.
 
-# Test to make sure intermediate .h file is not generated nor removed
-# if (AM_)?YFLAGS do not contain -d.  Requested by Jim Meyering.
-# See also the related semantic test 'yacc-d-basic.sh'.
+# Some grep-based checks on yacc support:
+#
+#  - Make sure intermediate .c file is built from yacc source.
+#    Report from Thomas Morgan.
+#
+#  - Make sure intermediate .h file is not generated nor removed
+#    if (AM_)?YFLAGS do not contain '-d'.
+#    Requested by Jim Meyering.
 
 . ./defs || exit 1
 
@@ -38,18 +43,21 @@ END
 cp Makefile.am Makefile.src
 
 $AUTOMAKE -a
+$FGREP 'zardoz.c' Makefile.in
 # If zardoz.h IS mentioned, fail.
 $FGREP 'zardoz.h' Makefile.in && exit 1
 
 cp Makefile.src Makefile.am
 echo 'AM_YFLAGS = -d' >> Makefile.am
 $AUTOMAKE
+$FGREP 'zardoz.c' Makefile.in
 # If zardoz.h is NOT mentioned, fail.
 $FGREP 'zardoz.h' Makefile.in
 
 cp Makefile.src Makefile.am
 echo 'AM_YFLAGS = ' >> Makefile.am
 $AUTOMAKE
+$FGREP 'zardoz.c' Makefile.in
 # If zardoz.h IS mentioned, fail.
 $FGREP 'zardoz.h' Makefile.in && exit 1
 
similarity index 100%
rename from t/yacc5.sh
rename to t/yacc-grepping2.sh
similarity index 100%
rename from t/yacc7.sh
rename to t/yacc-headers-and-dist-pr47.sh
similarity index 100%
rename from t/yacc8.sh
rename to t/yacc-subdir.sh
diff --git a/t/yacc.sh b/t/yacc.sh
deleted file mode 100755 (executable)
index 0a838a9..0000000
--- a/t/yacc.sh
+++ /dev/null
@@ -1,37 +0,0 @@
-#! /bin/sh
-# Copyright (C) 1996-2012 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 to make sure intermediate .c file is built from yacc source.
-# Bug from Thomas Morgan.
-
-. ./defs || exit 1
-
-cat >> configure.ac << 'END'
-AC_PROG_CC
-AC_PROG_YACC
-END
-
-cat > Makefile.am <<'END'
-bin_PROGRAMS = zardoz
-zardoz_SOURCES = zardoz.y
-END
-
-$ACLOCAL
-$AUTOMAKE -a
-
-$FGREP 'zardoz.c' Makefile.in
-
-: