automake-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Automake-commit] [SCM] GNU Automake branch, master, updated. v1.11-1830


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, master, updated. v1.11-1830-g96401cb
Date: Wed, 08 Feb 2012 09:10:27 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Automake".

http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=96401cb96cb4494023c59850d9f6a2912df22c24

The branch, master has been updated
       via  96401cb96cb4494023c59850d9f6a2912df22c24 (commit)
       via  5066c1b5019b7de419a7b4703c26cb79ee9c713d (commit)
      from  dec3c38232bb9006f02c6ca2a04d62e8f5b01125 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 96401cb96cb4494023c59850d9f6a2912df22c24
Author: Stefano Lattarini <address@hidden>
Date:   Mon Feb 6 15:48:30 2012 +0100

    tests: better way to compare lists in Makefile rules
    
    With this commit, we introduce a new helper shell script for use
    in the testsuite, which is meant to allow the test cases to easily
    check whether two whitespace-separated lists are equal; this ability
    is particularly useful to check for equality of the contents of make
    variables that are expected to contain multiple whitespace-separated
    words, and are defined through line continuations (or are rewritten
    by automake in this way), or that contain expansion of potentially
    empty variables.
    
    Before this change, a test checking that an usage like this one:
    
      VAR = valA
      if COND1
        VAR += val1 # com1
      endif COND1
      VAR += valC
    
    worked as expected, couldn't use rules like:
    
      ## Doesn't work because $(VAR) expands to multiple words
      verify:
          test $(VAR) = "valA val1 valC"
    
    nor like:
    
      ## Doesn't work because the final expansion of $(VAR) contains
      ## repeated contiguous whitespace characters (it actually
      ## equals "valA val1  valC", not "valA val1 valC"), and this
      ## is an internal detail which might change and which we don't
      ## want to explicitly rely on.
      verify:
          test "$(VAR)" = "valA val1 valC"
    
    Instead, we had to rely on cumbersome workaround such as:
    
      ## This works, but is ugly.
      verify:
          test "`echo $(VAR)`" = "valA val1 valC"
    
    or:
    
      ## This works, but is even uglier.
      verify:
          echo BEG: $(VAR) :END | grep "BEG: valA val1 valC :END"
    
    Now, with the help of the new 'is' script, we can perform such a
    check in a clearer and more straightforward way, as in:
    
      ## Works, and reads clearly.
      verify:
          is $(VAR) == valA val1 valC
    
    * tests/is: New helper shell script, telling whether two whitespace
    separated lists are equal.
    * Makefile.am (EXTRA_DIST): Add it.
    * tests/colneq2.test: Use the new helper script, and accordingly
    get rid of older, more cumbersome idioms.
    * tests/cond11.test: Likewise.
    * tests/cond16.test: Likewise.
    * tests/cond18.test: Likewise.
    * tests/cond22.test: Likewise.
    * tests/cond31.test: Likewise.
    * tests/cond38.test: Likewise.
    * tests/test-logs-repeated.test: Likewise.
    * tests/objext-pr10128.test: Likewise.
    * tests/programs-primary-rewritten.test: Likewise.
    * tests/substre2.test: Likewise.  Also ...
    (configure.in, Makefile.am): Add a couple of hack to avoid having
    to require (and run) a C compiler; accordingly ...
    ($required): ... remove this.
    * tests/exeext4.test: Likewise.
    * tests/substref.test: Likewise.  Also ...
    (hello.c): Use ": >" rather than "cat <<EOF" to generate it,
    since it's meant to be empty anyway.
    * tests/cond4.test: Use the new helper script, and accordingly
    get rid of older, more cumbersome idioms.  Avoid some unnecessary
    uses of "make -e" since we are at it.
    * tests/cond19.test: Likewise.
    * tests/cond32.test: Likewise.
    * tests/cond6.test: Use the new helper script, and accordingly
    move some checks in the Makefile.am.
    Avoid unnecessary execution of automake remake rules by manually
    "touching" aclocal.m4

commit 5066c1b5019b7de419a7b4703c26cb79ee9c713d
Author: Stefano Lattarini <address@hidden>
Date:   Fri Feb 3 15:05:48 2012 +0100

    tests: improve and rework tests on dependency tracking
    
    Fixes automake bug#10434.  Suggestion by Peter Rosin.
    
    The 'depcomp.tap' test case worked by trying to unconditionally
    force the compiler in use by the testsuite to use, one by one, *all*
    the dependency modes known by the 'depcomp' script, and, for each
    such forced mode that was compatible enough with said compiler not
    to cause breakage in the basic compilation rules, checking that it
    was *also* good enough not to break remake rules in VPATH builds.
    
    This seemed a good approach when this test was first introduced, as
    it apparently increased coverage for the less used and less tested
    dependency-tracking modes.  But in the log run it turned out the
    approach was actually in part too brittle, causing some annoying
    spurious failures (as with the Tru64 depmode forced on GCC, see
    automake bug#10434), and partly too forgiving, since, for some of
    the more corner-case dependency modes, the 'depcomp' script simply
    reverts to silently disabling dependency tracking when an error is
    encountered (this happened e.g., with the Tru64 depmode forced on
    the Sun C compiler 5.9), so that a passing test means nothing, and
    only gives a false sense of security.
    
    As Peter Rosin put it, "it's just dead wrong to assume that feeding
    -M or -xM to the compiler (or whatever other random stuff 'depcomp'
    might do) and not get an error is the same as dependencies magically
    appearing".
    
    So we get rid of this wrong approach, and in the process proceed to
    a complete overhaul of many of the tests on automatic dependency
    tracking, extending the offered coverage and rationalizing their
    organization.
    
    * tests/depcomp.sh: New helper script, used by several new
    autogenerated tests.
    * tests/gen-testsuite-part: Generate several tests based on the
    new 'depcomp.sh' script.  Emit makefile code that declares their
    dependency on that script, and that extends EXTRA_DIST in order
    to distribute it.
    * tests/depmod.tap: Remove.
    * tests/depend2.test: Remove, it has been subsumed by the new
    autogenerated test 'depcomp-disabled.tap'.
    * tests/depcomp3.test: Remove, it has been subsumed by the new
    autogenerated test 'depmod-dashmstdout.tap'.
    * tests/depcomp3.test: Remove, it has been subsumed by the new
    autogenerated test 'depmod-lt-makedepend.tap'.
    * tests/depcomp6.test: Remove, it has been subsumed by the new
    autogenerated test 'depmod-auto.tap'.
    * tests/depcomp7.test: Remove, it has been subsumed by the new
    autogenerated test 'depmod-lt-auto.tap'.
    * tests/depcomp5.test: Remove as obsolescent.
    * test/list-of-tests.mk: Adjust.
    * .gitignore: List the new autogenerated tests.

-----------------------------------------------------------------------

Summary of changes:
 .gitignore                            |    1 +
 tests/Makefile.am                     |    2 +-
 tests/colneq2.test                    |    6 +-
 tests/comment8.test                   |    5 +-
 tests/cond11.test                     |    7 +-
 tests/cond16.test                     |    4 +-
 tests/cond18.test                     |    6 +-
 tests/cond19.test                     |   14 +-
 tests/cond22.test                     |    4 +-
 tests/cond31.test                     |    6 +-
 tests/cond32.test                     |   11 +-
 tests/cond38.test                     |    4 +-
 tests/cond4.test                      |   16 +-
 tests/cond6.test                      |   15 +-
 tests/depcomp.sh                      |  390 +++++++++++++++++++++++++++++++++
 tests/depcomp3.test                   |   63 ------
 tests/depcomp4.test                   |   59 -----
 tests/depcomp5.test                   |   69 ------
 tests/depcomp6.test                   |  110 ---------
 tests/depcomp7.test                   |  126 -----------
 tests/depend2.test                    |   54 -----
 tests/depmod.tap                      |  209 ------------------
 tests/exeext4.test                    |   50 ++---
 tests/gen-testsuite-part              |   72 ++++++-
 tests/is                              |   54 +++++
 tests/list-of-tests.mk                |    7 -
 tests/objext-pr10128.test             |    4 +-
 tests/programs-primary-rewritten.test |    8 +-
 tests/substre2.test                   |   15 +-
 tests/substref.test                   |   19 +-
 tests/test-logs-repeated.test         |    4 +-
 31 files changed, 603 insertions(+), 811 deletions(-)
 create mode 100755 tests/depcomp.sh
 delete mode 100755 tests/depcomp3.test
 delete mode 100755 tests/depcomp4.test
 delete mode 100755 tests/depcomp5.test
 delete mode 100755 tests/depcomp6.test
 delete mode 100755 tests/depcomp7.test
 delete mode 100755 tests/depend2.test
 delete mode 100755 tests/depmod.tap
 create mode 100755 tests/is

diff --git a/.gitignore b/.gitignore
index 46607dc..c95a193 100644
--- a/.gitignore
+++ b/.gitignore
@@ -53,6 +53,7 @@ Makefile
 /tests/testsuite-part.am
 /tests/*-w.tap
 /tests/*-w.test
+/tests/depcomp-*.tap
 /tests/*.dir
 /tests/*.log
 /tests/*.trs
diff --git a/tests/Makefile.am b/tests/Makefile.am
index dc16ad5..873c08e 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -30,7 +30,7 @@ TAP_LOG_DRIVER = AM_TAP_AWK='$(AWK)' $(SHELL) 
$(top_srcdir)/lib/tap-driver.sh
 
 AM_TAP_LOG_DRIVER_FLAGS = --merge
 
-EXTRA_DIST = ChangeLog-old
+EXTRA_DIST = is ChangeLog-old
 
 TESTS = ## Will be updated later.
 
diff --git a/tests/colneq2.test b/tests/colneq2.test
index 8f408eb..fe117c9 100755
--- a/tests/colneq2.test
+++ b/tests/colneq2.test
@@ -1,6 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1996, 2001, 2002, 2010, 2011 Free Software Foundation,
-# Inc.
+# Copyright (C) 1996, 2001, 2002, 2010, 2011, 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
@@ -28,7 +28,7 @@ t = a b c
 EXTRA_DIST = $(t:=.test)
 .PHONY: test
 test:
-       test x'$(EXTRA_DIST)' = x'a.test b.test c.test'
+       is $(EXTRA_DIST) == a.test b.test c.test
 END
 
 $ACLOCAL
diff --git a/tests/comment8.test b/tests/comment8.test
index a9d6eaa..b2b12fe 100755
--- a/tests/comment8.test
+++ b/tests/comment8.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2004, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2004, 2011, 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
@@ -36,8 +36,9 @@ if COND2
   VAR += val2 # com2
 endif COND2
 
+.PHONY: test
 test:
-       test "`echo $(VAR)`" = 'valA valB val1 valC val2'
+       is $(VAR) == valA valB val1 valC val2
 EOF
 
 $ACLOCAL
diff --git a/tests/cond11.test b/tests/cond11.test
index 89ab482..90cbde3 100755
--- a/tests/cond11.test
+++ b/tests/cond11.test
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002, 2003, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003, 2011, 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
@@ -40,9 +41,9 @@ LDADD = $(SUBSTVAR) $(foolibs)
 
 .PHONY: test1 test2
 test1:
-       test faz.la = $(foo_DEPENDENCIES)
+       is faz.la == $(foo_DEPENDENCIES)
 test2:
-       test -z "`echo $(foo_DEPENDENCIES)`"
+       is "" == $(foo_DEPENDENCIES)
 END
 
 : > config.guess
diff --git a/tests/cond16.test b/tests/cond16.test
index 4efcbbd..7c4a264 100755
--- a/tests/cond16.test
+++ b/tests/cond16.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2011, 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
@@ -43,7 +43,7 @@ hell_SOURCES = $(var:=)
 
 .PHONY: test
 test:
-       test "`echo $(hell_SOURCES) $(hell_OBJECTS)`" = "foo.c foo.o"
+       is $(hell_SOURCES) $(hell_OBJECTS) == foo.c foo.o
 END
 
 $ACLOCAL
diff --git a/tests/cond18.test b/tests/cond18.test
index 366dfd0..fa04d56 100755
--- a/tests/cond18.test
+++ b/tests/cond18.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2011, 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
@@ -48,8 +48,8 @@ helldl_SOURCES = $(var3)
 
 .PHONY: test
 test:
-       test x"`echo $(helldl_SOURCES) $(helldl_OBJECTS)`" = \
-            x"dlmain.c foo.c dlmain.obj foo.obj"
+       is $(helldl_SOURCES) $(helldl_OBJECTS) == \
+           dlmain.c foo.c dlmain.obj foo.obj
 
 bin_PROGRAMS = helldl
 END
diff --git a/tests/cond19.test b/tests/cond19.test
index d1ba08a..17ead91 100755
--- a/tests/cond19.test
+++ b/tests/cond19.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2011, 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
@@ -48,11 +48,9 @@ endif
 
 helldl_SOURCES = $(var3:.c=1.c) $(var4:.c=2.c)
 
-got = `echo $(helldl_SOURCES) $(helldl_OBJECTS)`
-
 .PHONY: test
 test:
-       test x"$(exp)" = x"$(got)"
+       is $(exp) == $(helldl_SOURCES) $(helldl_OBJECTS)
 END
 
 $ACLOCAL
@@ -60,12 +58,12 @@ $AUTOCONF
 $AUTOMAKE -a -i
 
 CONDITION1=true CONDITION2=true ./configure
-exp='dlmaina1.c dlmainb2.c dlmaina1.o dlmainb2.o' $MAKE -e test
+$MAKE test exp='dlmaina1.c dlmainb2.c dlmaina1.o dlmainb2.o'
 CONDITION1=true CONDITION2=false ./configure
-exp='dlmainb1.c dlmaina2.c dlmainb1.o dlmaina2.o' $MAKE -e test
+$MAKE test exp='dlmainb1.c dlmaina2.c dlmainb1.o dlmaina2.o'
 CONDITION1=false CONDITION2=true ./configure
-exp='dlmaina1.c dlmainb2.c dlmaina1.o dlmainb2.o' $MAKE -e test
+$MAKE test exp='dlmaina1.c dlmainb2.c dlmaina1.o dlmainb2.o'
 CONDITION1=false CONDITION2=false ./configure
-exp='dlmainb1.c dlmaina2.c dlmainb1.o dlmaina2.o' $MAKE -e test
+$MAKE test exp='dlmainb1.c dlmaina2.c dlmainb1.o dlmaina2.o'
 
 :
diff --git a/tests/cond22.test b/tests/cond22.test
index 72120eb..cc46745 100755
--- a/tests/cond22.test
+++ b/tests/cond22.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2002, 2003, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2011, 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
@@ -57,7 +57,7 @@ targ_SOURCES = $(SONE) $(STWO) $(STHREE) $(STHREE2)
 
 .PHONY: test
 test:
-       test "`echo $(targ_OBJECTS)`" = "one.oo two.oo three.oo three2.oo"
+       is $(targ_OBJECTS) == one.oo two.oo three.oo three2.oo
 END
 
 $ACLOCAL
diff --git a/tests/cond31.test b/tests/cond31.test
index b94820e..69b8fc1 100755
--- a/tests/cond31.test
+++ b/tests/cond31.test
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Copyright (C) 2003, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2011, 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
@@ -38,9 +38,9 @@ endif
 
 .PHONY: test1 test2
 test1:
-       test "`echo $(a_DEPENDENCIES)`" = "c0.o c1.o"
+       is $(a_DEPENDENCIES) == c0.o c1.o
 test2:
-       test "`echo $(a_DEPENDENCIES)`" = "c0.o c2.o c3.la"
+       is $(a_DEPENDENCIES) == c0.o c2.o c3.la
 EOF
 
 $ACLOCAL
diff --git a/tests/cond32.test b/tests/cond32.test
index 45ecf70..738903a 100755
--- a/tests/cond32.test
+++ b/tests/cond32.test
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Copyright (C) 2003, 2006, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006, 2011, 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
@@ -50,9 +50,8 @@ endif
 a_LDADD = $(BAR)
 endif
 
-got = `echo $(a_DEPENDENCIES)`
 test:
-       test "$(exp)" = "$(got)"
+       is $(exp) == $(a_DEPENDENCIES)
 .PHONY: test
 EOF
 
@@ -61,12 +60,12 @@ $AUTOCONF
 $AUTOMAKE
 
 ./configure
-exp='foo.o nonsense.a' $MAKE -e test
+$MAKE test exp='foo.o nonsense.a'
 
 ./configure two=yes three=
-exp='bar.o' $MAKE -e test
+$MAKE test exp='bar.o'
 
 ./configure two=yes three=yes
-exp='baz.o' $MAKE -e test
+$MAKE test exp='baz.o'
 
 :
diff --git a/tests/cond38.test b/tests/cond38.test
index 8638dae..bc313b8 100755
--- a/tests/cond38.test
+++ b/tests/cond38.test
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Copyright (C) 2005, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2005, 2011, 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
@@ -49,7 +49,7 @@ endif
 
 .PHONY: test
 test:
-       test "`echo $(SUBDIRS)`" = 'a b c d e f g h iXYZ jZYX'
+       is $(SUBDIRS) == a b c d e f g h iXYZ jZYX
 EOF
 
 mkdir a b c d e f g h iXYZ jZYX
diff --git a/tests/cond4.test b/tests/cond4.test
index 3071577..40dfa2f 100755
--- a/tests/cond4.test
+++ b/tests/cond4.test
@@ -1,6 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1998, 2001, 2002, 2010, 2011 Free Software Foundation,
-# Inc.
+# Copyright (C) 1998, 2001, 2002, 2010, 2011, 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
@@ -40,11 +40,9 @@ endif
 
 targ_SOURCES = main.c $(OPT1) $(OPT2)
 
-got = `echo $(targ_OBJECTS)`
-
 .PHONY: test
 test:
-       test x"$(exp)" = x"$(got)"
+       is $(exp) == $(targ_OBJECTS)
 END
 
 $ACLOCAL
@@ -57,12 +55,12 @@ grep 'address@hidden@' Makefile.in && Exit 1
 $AUTOCONF
 
 CONDITION1=true CONDITION2=true ./configure
-exp='main.o one.o two.o' $MAKE -e test
+$MAKE test exp='main.o one.o two.o'
 CONDITION1=true CONDITION2=false ./configure
-exp='main.o one.o' $MAKE -e test
+$MAKE test exp='main.o one.o'
 CONDITION1=false CONDITION2=true ./configure
-exp='main.o two.o' $MAKE -e test
+$MAKE test exp='main.o two.o'
 CONDITION1=false CONDITION2=false ./configure
-exp='main.o' $MAKE -e test
+$MAKE test exp='main.o'
 
 :
diff --git a/tests/cond6.test b/tests/cond6.test
index 0ac1783..3080320 100755
--- a/tests/cond6.test
+++ b/tests/cond6.test
@@ -1,6 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1998, 2001, 2002, 2010, 2011 Free Software Foundation,
-# Inc.
+# Copyright (C) 1998, 2001, 2002, 2010, 2011, 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
@@ -39,9 +39,9 @@ endif
 a b c d e f g h:
        touch $@
 
-.PHONY: print-data
-print-data:
-       echo BEG: $(help_DATA) :END
+.PHONY: test
+test:
+       is $(help_DATA) == a b c d e f g h
 END
 
 
@@ -54,14 +54,13 @@ $AUTOMAKE
 rm -rf autom4te*.cache
 
 echo AC_OUTPUT >> configure.in
+touch aclocal.m4 # Avoid unnecessary firing the remake rules.
 $AUTOCONF
 $AUTOMAKE Makefile
 
 ./configure --prefix="`pwd`/_inst"
 
-$MAKE print-data >stdout || { cat stdout; Exit 1; }
-cat stdout
-grep '^BEG: a b c d e f g h :END$' stdout
+$MAKE test
 
 $MAKE install
 for x in a b c d e f g h; do
diff --git a/tests/depcomp.sh b/tests/depcomp.sh
new file mode 100755
index 0000000..67db770
--- /dev/null
+++ b/tests/depcomp.sh
@@ -0,0 +1,390 @@
+#! /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/>.
+
+# Check dependency tracking in various flavours.
+# Contains both libtool and non-libtool case.
+# Sourced by the various (autogenerated) 'depcomp*.tap' tests.
+# Examples of reported failures that motivated those test are
+# listed below.
+
+# -------------------------------------------------------------------------
+
+# <http://lists.gnu.org/archive/html/automake-patches/2011-04/msg00028.html>
+#
+# Here's the bug: makedepend will prefix VPATH to the object file name,
+# thus the second make will invoke depcomp with object='../../src/foo.o',
+# causing errors such as:
+#
+#  touch: cannot touch `../../src/.deps/foo.TPo': No such file or directory
+#  makedepend: error:  cannot open "../../src/.deps/foo.TPo"
+#  ../../depcomp: line 560: ../../src/.deps/foo.TPo: No such file or directory
+
+# -------------------------------------------------------------------------
+
+# <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8473>
+# <http://lists.gnu.org/archive/html/automake-patches/2011-04/msg00079.html>
+#
+# Here's the bug: hp depmode will prefix VPATH to the object file name,
+# thus the second gmake will invoke depcomp with object='../../src/foo.o',
+# causing errors such as (broken on multiple lines for clarity):
+#
+#   cpp: "", line 0: error 4066: Cannot create
+#        "../../gllib/.deps/nonblocking.TPo" file for
+#        "-M../../gllib/.deps/nonblocking.TPo" option.
+#        (No such file or directory[errno=2])
+#
+
+# -------------------------------------------------------------------------
+
+# <http://lists.gnu.org/archive/html/automake-patches/2011-04/msg00140.html>
+# <http://lists.gnu.org/archive/html/automake-patches/2011-05/msg00019.html>
+#
+# A partial failure of an earlier version of this test; some bad
+# post-processing of the `*.Po' files led to the following broken
+# contents of `src/sub/.deps/subfoo.Po':
+#
+#  > sub/subfoo.o: ../../depmod-data.dir/src/sub/subfoo.c \
+#  >   ../../depmod-data.dir/src/foo.h
+#  > ../../depmod-data.dir/src/sub/subfoo.c \:
+#  >   ../../depmod-data.dir/src/foo.h:
+#
+# which caused make to die with an error like:
+#
+#  "sub/.deps/subfoo.Po:3: *** missing separator.  Stop."
+
+# -------------------------------------------------------------------------
+
+am_create_testdir=empty
+. ./defs || Exit 1
+
+ocwd=`pwd` || fatal_ "cannot get current working directory"
+longpath=this-is/a-path/which-has/quite-a/definitely/truly/long_long_name
+cachevar=am_cv_CC_dependencies_compiler_type
+
+srctree=depmod-1.0
+mkdir $srctree
+cd $srctree
+
+cd_top ()
+{
+  cd "$ocwd" || fatal_ "cannot chdir back to top directory"
+}
+
+delete ()
+{
+  test -f "$1" || fatal_ "$1: file does not exist"
+  rm -f "$1" || fatal_ "$1: couldn't remove"
+}
+
+edit ()
+{
+  file=$1; shift
+  sed "$@" <"$file" > t && mv -f t "$file" \
+    || fatal_ "$file: editing of file failed"
+}
+
+rewrite ()
+{
+  file=$1; shift
+  "$@" > "$file" || fatal_ "$file: couldn't rewrite"
+}
+
+setup_srcdir ()
+{
+  srcdir=$1 # This is intended to be global.
+  mkdir -p "$srcdir" \
+    || fatal_ "couldn't create source directory '$srcdir'"
+  cp -pR "$ocwd/$srctree"/* "$srcdir"/ \
+    || fatal_ "couldn't populate source directory '$srcdir'"
+}
+
+
+check_no_depfiles ()
+{
+  find . -name '*.Plo' -o -name '*.Po' | grep . && return 1
+  return 0
+}
+
+check_distclean ()
+{
+  # "make distcleancheck" can only run from a VPATH build.
+  if test $vpath = no; then
+    make_ok distclean && check_no_depfiles
+  else
+    $MAKE distcleancheck
+  fi
+}
+
+cat > configure.in <<END
+AC_INIT([$me], [1.0])
+AC_CONFIG_AUX_DIR([build-aux])
+AM_INIT_AUTOMAKE
+AC_PROG_CC
+AM_PROG_CC_C_O
+AM_PROG_AR
+`if test $depcomp_with_libtool = yes; then
+  echo AC_PROG_LIBTOOL
+else
+  echo AC_PROG_RANLIB
+fi`
+AC_CONFIG_FILES([Makefile src/Makefile])
+AC_OUTPUT
+END
+
+mkdir build-aux sub src src/sub2
+
+case $depcomp_with_libtool in
+  yes)
+    plan_ 84
+    po=Plo objext=lo a=la
+    normalized_target=libfoo_la
+    LIBPRIMARY=LTLIBRARIES LINKADD=LIBADD
+    echo lib_LTLIBRARIES = libfoo.la >> Makefile.am
+    make_ok ()
+    {
+      $MAKE ${1+"$@"} >output 2>&1 || { cat output; return 1; }
+      cat output
+      $FGREP 'unknown directive' output && return 1
+      rm -f output
+      # Checks for stray files possibly left around by less common
+      # depmodes.
+      find . -name '*.[ud]' | grep . && return 1
+      return 0
+    }
+    ;;
+  no)
+    plan_ 28
+    po=Po objext='$(OBJEXT)' a=a
+    normalized_target=foo
+    LIBPRIMARY=LIBRARIES LINKADD=LDADD
+    echo bin_PROGRAMS = foo >> Makefile.am
+    make_ok ()
+    {
+      $MAKE ${1+"$@"}
+    }
+    ;;
+  *)
+    fatal_ "invalid value '$depcomp_with_libtool' for variable" \
+           "\$depcomp_with_libtool"
+    ;;
+esac
+
+cat >> Makefile.am <<END
+SUBDIRS = src
+# We include subfoo only to be sure that the munging in depcomp
+# doesn't remove too much from the object file name.
+${normalized_target}_SOURCES = foo.c sub/subfoo.c foo.h sub/subfoo.h
+${normalized_target}_${LINKADD} = src/libbaz.$a
+
+.PHONY: grep-test
+grep-test:
+## For debugging.
+       cat \$(DEPDIR)/foo.$po || :
+       cat \$(DEPDIR)/subfoo.$po || :
+       cat src/\$(DEPDIR)/baz.$po || :
+       cat src/sub2/\$(DEPDIR)/sub2foo.$po || :
+## Checks done here.
+       grep '^foo.$objext.*:' \$(DEPDIR)/foo.$po
+       grep '^subfoo\.$objext.*:' \$(DEPDIR)/subfoo.$po
+       grep '^baz\.$objext.*:' src/\$(DEPDIR)/baz.$po
+       grep '^sub2/sub2foo\.$objext.*:' src/sub2/\$(DEPDIR)/sub2foo.$po
+END
+
+cat > src/Makefile.am <<END
+AUTOMAKE_OPTIONS = subdir-objects
+noinst_${LIBPRIMARY} = libbaz.$a
+# We include sub2foo only to be sure that the munging in depcomp
+# doesn't remove too much from the object file name.
+libbaz_${a}_SOURCES = baz.c sub2/sub2foo.c baz.h sub2/sub2foo.h
+END
+
+cat > foo.c <<'END'
+#include "foo.h"
+#include "src/baz.h"
+#include <stdlib.h>
+int main (void)
+{
+  printf ("foo bar\n");
+  exit (EXIT_SUCCESS + subfoo () + baz ());
+}
+END
+
+cat > foo.h <<'END'
+#include <stdio.h>
+#include "sub/subfoo.h"
+END
+
+cat > sub/subfoo.c <<'END'
+#include "sub/subfoo.h"
+int subfoo (void) { return 0; }
+END
+
+echo '/* empty */' > src/sub2/sub2foo.h
+
+cat > sub/subfoo.h <<'END'
+#include <stdio.h>
+extern int subfoo (void);
+END
+
+cat > src/baz.c <<'END'
+#include "baz.h"
+int baz (void) { return 0; }
+END
+
+cat > src/baz.h <<'END'
+extern int baz (void);
+END
+
+cat > src/sub2/sub2foo.c <<'END'
+#include "sub2foo.h"
+int sub2foo (void) { return 0; }
+END
+
+test $depcomp_with_libtool = no || libtoolize \
+  || fatal_ "libtoolize failed"
+$ACLOCAL && $AUTOCONF && $AUTOMAKE -a \
+  || fatal_ "autotools failed"
+test -f build-aux/depcomp \
+  || fatal_ "depcomp script not installed"
+
+case $depmode in
+  auto)
+    displayed_depmode='..*' # At least one character long.
+    cfg_deptrack=--enable-dependency-tracking ;;
+  disabled)
+    displayed_depmode=none
+    cfg_deptrack=--disable-dependency-tracking ;;
+  *)
+    displayed_depmode="(cached) $depmode"
+    cfg_deptrack="$cachevar=$depmode"
+    # Sanity check: ensure the cache variable we force is truly
+    # used by configure.
+    $FGREP $cachevar configure \
+      || fatal_ "configure lacks required cache variable '$cachevar'";;
+esac
+
+cd_top
+
+do_test ()
+{
+  cd_top
+  if test $vpath = no; then
+    pfx="in-tree build"
+  else
+    pfx="$vpath VPATH"
+  fi
+  if test $# -gt 0; then
+    subdir=$1; shift
+    pfx="$pfx, $subdir"
+    test -d $subdir || mkdir $subdir || fatal_ "creating directory $subdir"
+    cd $subdir
+  fi
+  pfx="[$pfx]"
+  case $vpath in
+    simple)
+      mkdir -p vpath-simple/build
+      cd vpath-simple/build
+      setup_srcdir ..
+      ;;
+    long)
+      mkdir -p vpath-long/src vpath-long/wrk
+      cd vpath-long/wrk
+      setup_srcdir ../src/$longpath
+      ;;
+    absolute)
+      mkdir -p vpath-abs/build
+      cd vpath-abs/build
+      absdir="`(cd .. && pwd)`" || fatal_ "getting absolute directory"
+      setup_srcdir "$absdir/vpath-abs"
+      unset absdir
+      ;;
+    no)
+      mkdir intree
+      cd intree
+      setup_srcdir .
+      ;;
+    *)
+      fatal_ "invalid value '$vpath' for variable \$vpath"
+      ;;
+  esac
+
+  command_ok_ \
+    "$pfx configure" \
+    "$srcdir/configure" $cfg_deptrack ${1+"$@"} >stdout
+  cat stdout
+
+  command_ok_ \
+    "$pfx right depmode selected" \
+    grep "^checking dependency style .*\.\.\. $displayed_depmode$" stdout
+  rm -f stdout
+
+  command_ok_ "$pfx simple make" make_ok
+  # Some bugs in VPATH builds only kick in during a rebuild.
+  command_ok_ "$pfx clean & rebuild" eval '$MAKE clean && make_ok'
+
+  if test $depmode = disabled; then
+      command_ok_ "$pfx no dependency files generated" check_no_depfiles
+      r=ok \
+        && grep "[ $tab]depmode=none" Makefile \
+        && rewrite "$srcdir"/src/sub2/sub2foo.h echo 'choke me' \
+        && delete "$srcdir"/sub/subfoo.h \
+        && make_ok \
+        || r='not ok'
+      result_ "$r" "$pfx dependency tracking is truly disabled"
+  elif grep "[ $tab]depmode=none" Makefile; then
+    skip_row_ 2 -r "automatic dependency tracking couldn't be activated"
+  else
+    command_ok_ "$pfx generated $po files look correct" $MAKE grep-test
+    r=ok \
+      && : "Some checks in the subdir." \
+      && $sleep \
+      && : "Ensure rebuild rules really kick in." \
+      && rewrite "$srcdir"/src/sub2/sub2foo.h echo 'choke me' \
+      && cd src \
+      && not $MAKE  \
+      && cd .. \
+      && : "Ensure the deleted header bug is fixed." \
+      && delete "$srcdir"/src/sub2/sub2foo.h \
+      && edit "$srcdir"/src/sub2/sub2foo.c -e 1d \
+      && cd src \
+      && make_ok \
+      && : "Now do similar checks for the parent directory." \
+      && cd .. \
+      && rewrite "$srcdir"/sub/subfoo.h echo 'choke me' \
+      && not $MAKE \
+      && delete "$srcdir"/sub/subfoo.h \
+      && edit "$srcdir"/sub/subfoo.c -e 1d \
+      && edit "$srcdir"/foo.h -e 2d \
+      && make_ok \
+      || r='not ok'
+    result_ "$r" "$pfx dependency tracking works"
+  fi
+
+  command_ok_ "$pfx make distclean" check_distclean
+  cd_top
+}
+
+for vpath in no simple long absolute; do
+  if test $depcomp_with_libtool = no; then
+    do_test
+  else
+    do_test default
+    do_test noshared --disable-shared
+    do_test nostatic --disable-static
+  fi
+done
+
+:
diff --git a/tests/depcomp3.test b/tests/depcomp3.test
deleted file mode 100755
index 058d7e9..0000000
--- a/tests/depcomp3.test
+++ /dev/null
@@ -1,63 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2003, 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/>.
-
-# Make sure dashmstdout generates dependencies.
-
-required='gcc'
-. ./defs || Exit 1
-
-cat >> configure.in << 'END'
-AC_PROG_CC
-AM_PROG_CC_C_O
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-AUTOMAKE_OPTIONS = subdir-objects
-check_PROGRAMS = prg
-prg_SOURCES = src/sub.c src/foo.h
-
-.PHONY: grepdeps
-grepdeps:
-       grep 'src/sub\.$(OBJEXT).*:' src/$(DEPDIR)/sub.Po
-
-END
-
-mkdir src
-
-: > src/foo.h
-
-cat >src/sub.c <<EOF
-#include "foo.h"
-int
-main ()
-{
-   return 0;
-}
-EOF
-
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE -a
-
-# Sanity check: make sure the cache variable we force is used by configure.
-grep am_cv_CC_dependencies_compiler_type configure
-
-./configure am_cv_CC_dependencies_compiler_type=dashmstdout
-$MAKE check
-$MAKE grepdeps
-
-:
diff --git a/tests/depcomp4.test b/tests/depcomp4.test
deleted file mode 100755
index fc62990..0000000
--- a/tests/depcomp4.test
+++ /dev/null
@@ -1,59 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2003, 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 PR 385: makedepend doesn't work with Libtool.
-
-required='libtoolize gcc makedepend'
-. ./defs || Exit 1
-
-cat >> configure.in << 'END'
-AC_PROG_CC
-AM_PROG_AR
-AC_PROG_LIBTOOL
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-noinst_LTLIBRARIES = liba.la
-liba_la_SOURCES = a.c foo.h
-
-.PHONY: grepdeps
-grepdeps:
-       grep 'a\.lo *:' ./$(DEPDIR)/a.Plo
-END
-
-: > foo.h
-
-cat >a.c <<EOF
-#include "foo.h"
-int a() { return 0; }
-EOF
-
-libtoolize --force
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE -a
-
-# Sanity check: make sure the cache variable we force is used by configure.
-grep am_cv_CC_dependencies_compiler_type configure
-
-./configure am_cv_CC_dependencies_compiler_type=makedepend
-$MAKE >output 2>&1 || { cat output; Exit 1; }
-cat output
-grep 'unknown directive' output && Exit 1
-$MAKE grepdeps
-
-:
diff --git a/tests/depcomp5.test b/tests/depcomp5.test
deleted file mode 100755
index 586a98b..0000000
--- a/tests/depcomp5.test
+++ /dev/null
@@ -1,69 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2003, 2004, 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/>.
-
-# Check icc's dependency mode.
-
-required='icc'
-. ./defs || Exit 1
-
-# Automake supports icc since version 7.0 through a dedicated depcomp mode.
-# icc 8.0 and greater understand gcc options, so depmode is set to gcc.
-if icc -V -help 2>&1 | grep 'Version 7'; then
-  expect='depmode=icc'
-else
-  expect='depmode=gcc'
-fi
-
-cat >> configure.in << 'END'
-AC_PROG_CC
-AM_PROG_CC_C_O
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-AUTOMAKE_OPTIONS = subdir-objects
-check_PROGRAMS = prg
-prg_SOURCES = src/sub.c src/foo.h
-
-.PHONY: grepdeps
-grepdeps:
-       grep 'src/sub\.$(OBJEXT).*:' src/$(DEPDIR)/sub.Po
-
-END
-
-mkdir src
-
-touch src/foo.h
-
-cat >src/sub.c <<EOF
-#include "foo.h"
-int
-main ()
-{
-   return 0;
-}
-EOF
-
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE -a
-
-./configure
-grep "$expect" Makefile
-$MAKE check
-$MAKE grepdeps
-
-:
diff --git a/tests/depcomp6.test b/tests/depcomp6.test
deleted file mode 100755
index 2d43c28..0000000
--- a/tests/depcomp6.test
+++ /dev/null
@@ -1,110 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2006, 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/>.
-
-# Check dependency generation (non libtool case).
-
-required=cc
-. ./defs || Exit 1
-
-cat >> configure.in << 'END'
-AC_PROG_CC
-AM_PROG_CC_C_O
-AM_PROG_AR
-AC_PROG_RANLIB
-AC_CONFIG_FILES([sub2/Makefile])
-AC_OUTPUT
-END
-
-mkdir sub sub2 sub2/sub3
-
-cat >Makefile.am <<'END'
-SUBDIRS = sub2
-bin_PROGRAMS = foo
-foo_SOURCES = foo.c sub/bar.c foo.h sub/bar.h
-foo_LDADD = sub2/libbaz.a
-END
-
-cat >sub2/Makefile.am <<'END'
-AUTOMAKE_OPTIONS = subdir-objects
-noinst_LIBRARIES = libbaz.a
-libbaz_a_SOURCES = baz.c sub3/ba3.c baz.h sub3/ba3.h
-END
-
-cat >foo.c <<'END'
-#include "foo.h"
-#include "sub2/baz.h"
-#include <stdlib.h>
-int main (void) { printf ("foo"); return bar () + baz (); }
-END
-
-cat >foo.h <<'END'
-#include <stdio.h>
-#include "sub/bar.h"
-END
-
-cat >sub/bar.c <<'END'
-#include "sub/bar.h"
-int bar (void) { return 0; }
-END
-
-touch sub2/sub3/ba3.h
-
-cat >sub/bar.h <<'END'
-#include <stdio.h>
-extern int bar (void);
-END
-
-cat >sub2/baz.c <<'END'
-#include "baz.h"
-int baz (void) { return 0; }
-END
-
-cat >sub2/baz.h <<'END'
-extern int baz (void);
-END
-
-cat >sub2/sub3/ba3.c <<'END'
-#include "ba3.h"
-int ba3 (void) { return 0; }
-END
-
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE -a
-
-./configure --enable-dependency-tracking
-$MAKE
-
-if grep 'depmode=none' Makefile; then
-  skip_ "automatic dependency tracking couldn't be activated"
-fi
-
-cd sub2
-$sleep
-echo 'choke me' > sub3/ba3.h
-# Do not use `$MAKE && Exit 1' here, since even relatively-recent
-# versions of the BSD shell wrongly exit when the `errexit' shell
-# flag is active if a command within "&&" fails inside a compound
-# statement.
-if $MAKE; then Exit 1; else :; fi
-
-# Ensure the deleted header bug is fixed.
-rm -f sub3/ba3.h
-sed 1d sub3/ba3.c >sub3/ba3.t
-mv -f sub3/ba3.t sub3/ba3.c
-$MAKE
-
-:
diff --git a/tests/depcomp7.test b/tests/depcomp7.test
deleted file mode 100755
index f553894..0000000
--- a/tests/depcomp7.test
+++ /dev/null
@@ -1,126 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2006, 2007, 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/>.
-
-# Check dependency generation (libtool case).
-
-required='cc libtoolize'
-. ./defs || Exit 1
-
-cat >> configure.in << 'END'
-AC_PROG_CC
-AM_PROG_CC_C_O
-AM_PROG_AR
-AM_PROG_LIBTOOL
-AC_CONFIG_FILES([sub2/Makefile])
-AC_OUTPUT
-END
-
-mkdir sub sub2 sub2/sub3
-
-cat >Makefile.am <<'END'
-SUBDIRS = sub2
-bin_PROGRAMS = foo
-foo_SOURCES = foo.c sub/bar.c foo.h sub/bar.h
-foo_LDADD = sub2/libbaz.la
-END
-
-cat >sub2/Makefile.am <<'END'
-AUTOMAKE_OPTIONS = subdir-objects
-noinst_LTLIBRARIES = libbaz.la
-libbaz_la_SOURCES = baz.c sub3/ba3.c baz.h sub3/ba3.h
-END
-
-cat >foo.c <<'END'
-#include "foo.h"
-#include "sub2/baz.h"
-#include <stdlib.h>
-int main (void) { printf ("foo"); return bar () + baz (); }
-END
-
-cat >foo.h <<'END'
-#include <stdio.h>
-#include "sub/bar.h"
-END
-
-cat >sub/bar.c <<'END'
-#include "sub/bar.h"
-int bar (void) { return 0; }
-END
-
-echo 'extern int x;' > sub2/sub3/ba3.h
-
-cat >sub/bar.h <<'END'
-#include <stdio.h>
-extern int bar (void);
-END
-
-cat >sub2/baz.c <<'END'
-#include "baz.h"
-int baz (void) { return 0; }
-END
-
-cat >sub2/baz.h <<'END'
-extern int baz (void);
-END
-
-cat >sub2/sub3/ba3.in <<'END'
-#include "ba3.h"
-int ba3 (void) { return 0; }
-END
-
-libtoolize
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE -a
-
-st=0
-for staticshared in --disable-shared "" --disable-static; do
-
-  cp sub2/sub3/ba3.in sub2/sub3/ba3.c
-  ./configure --enable-dependency-tracking $staticshared
-  $MAKE
-
-  # If we cannot enable dependency tracking, perform only the most basic
-  # checks, and don't consider this test to be PASSed but SKIPped, because
-  # the main purpose of this test is exposing the depmode features.
-  if grep 'depmode=none' Makefile; then
-    st=77
-  else
-    cd sub2
-    $sleep
-    echo 'choke me' > sub3/ba3.h
-    # Do not use `$MAKE && Exit 1' here, since even relatively-recent
-    # versions of the BSD shell wrongly exit when the `errexit' shell
-    # flag is active if a command within "&&" fails inside a compound
-    # statement.
-    if $MAKE; then Exit 1; else :; fi
-
-    # Ensure the deleted header bug is fixed.
-    rm -f sub3/ba3.h
-    sed 1d sub3/ba3.in >sub3/ba3.c
-    $MAKE
-    cd ..
-  fi
-
-  $MAKE distclean
-  test ! -f sub2/sub3/ba3.u
-  test ! -f sub2/sub3/ba3.d
-
-  echo 'extern int x;' > sub2/sub3/ba3.h
-
-done
-
-Exit $st
diff --git a/tests/depend2.test b/tests/depend2.test
deleted file mode 100755
index ec949e3..0000000
--- a/tests/depend2.test
+++ /dev/null
@@ -1,54 +0,0 @@
-#! /bin/sh
-# Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 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 to make sure dependency tracking works with
-# --disable-dependency-tracking.
-# Report from Robert Boehne.
-
-required=cc
-. ./defs || Exit 1
-
-cat >> configure.in << 'END'
-AC_PROG_CC
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-bin_PROGRAMS = hello
-END
-
-cat > hello.h << 'END'
-#include <stdio.h>
-END
-
-cat > hello.c << 'END'
-#include "hello.h"
-int main (int argc, char *argv[])
-{
-   printf ("yeah, yeah\n");
-   return 0;
-}
-END
-
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE -a
-
-./configure --disable-dependency-tracking
-$MAKE
-
-:
diff --git a/tests/depmod.tap b/tests/depmod.tap
deleted file mode 100755
index e1fbef5..0000000
--- a/tests/depmod.tap
+++ /dev/null
@@ -1,209 +0,0 @@
-#! /bin/sh
-# Copyright (C) 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/>.
-
-# Check that dependency tracking in various flavours works with VPATH
-# builds.  Examples of reported failures follows ...
-
-# <http://lists.gnu.org/archive/html/automake-patches/2011-04/msg00028.html>
-#
-# Here's the bug: makedepend will prefix VPATH to the object file name,
-# thus the second make will invoke depcomp with object='../../src/foo.o',
-# causing errors such as:
-# touch: cannot touch `../../src/.deps/foo.TPo': No such file or directory
-# makedepend: error:  cannot open "../../src/.deps/foo.TPo"
-# ../../depcomp: line 560: ../../src/.deps/foo.TPo: No such file or directory
-
-# <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8473>
-# <http://lists.gnu.org/archive/html/automake-patches/2011-04/msg00079.html>
-#
-# Here's the bug: hp depmode will prefix VPATH to the object file name,
-# thus the second gmake will invoke depcomp with object='../../src/foo.o',
-# causing errors such as (broken on multiple lines for clarity):
-#   cpp: "", line 0: error 4066: Cannot create
-#        "../../gllib/.deps/nonblocking.TPo" file for
-#        "-M../../gllib/.deps/nonblocking.TPo" option.
-#        (No such file or directory[errno=2])
-#
-
-# <http://lists.gnu.org/archive/html/automake-patches/2011-04/msg00140.html>
-# <http://lists.gnu.org/archive/html/automake-patches/2011-05/msg00019.html>
-#
-# A partial failure of an earlier version of this test; some bad
-# post-processing of the `*.Po' files led to the following broken
-# contents of `src/sub/.deps/subfoo.Po':
-#  > sub/subfoo.o: ../../depmod-data.dir/src/sub/subfoo.c \
-#  >   ../../depmod-data.dir/src/foo.h
-#  > ../../depmod-data.dir/src/sub/subfoo.c \:
-#  >   ../../depmod-data.dir/src/foo.h:
-# which caused make to die with an error like:
-#  "sub/.deps/subfoo.Po:3: *** missing separator.  Stop."
-
-required=cc
-. ./defs || Exit 99
-
-# Keep this in sync with the contents of depend.m4.
-all_depmodes=`\
-  sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < "$am_scriptdir/depcomp" \
-    | grep -v '^none$'` \
-  && : Turn newlines and tabs into spaces, and strip extra whitespace. \
-  && all_depmodes=`echo $all_depmodes` \
-  && test -n "$all_depmodes" \
-  || fatal_ "can't extract list of valid depmodes"
-
-# Allow the user to select a subset of the tests.
-if test $# -gt 0; then
-  tested_depmodes=$*
-  for depmode in $tested_depmodes; do
-    case " $all_depmodes " in
-      *" $depmode "*);;
-      *) fatal_ "invalid user-specified depmode '$depmode'"
-    esac
-  done
-  n=`for m in $tested_depmodes; do echo $m; done | wc -l`
-  # We need to determine the TAP plan adaptively.
-  # Per each valid depmode three kinds of VPATH, and per each of them
-  # a test on "./configure" and one on "make & remake"; so there are
-  # $n * 3 * 2 tests.
-  plan_ `expr $n '*' 6`
-  unset n
-else
-  tested_depmodes=$all_depmodes
-  # Prefer static TAP plan if possible, minimizes the chance of errors.
-  plan_ 102
-fi
-
-ocwd=`pwd` || fatal_ "cannot get current working directory"
-
-srctree=depmod-1.0
-mkdir $srctree
-mv missing install-sh depcomp configure.in $srctree
-cd $srctree
-
-mkdir src src/sub
-
-cat >> configure.in << 'END'
-AC_CONFIG_FILES([src/Makefile])
-AC_PROG_CC
-AM_PROG_CC_C_O
-AC_OUTPUT
-END
-
-echo 'SUBDIRS = src' > Makefile.am
-
-cat > src/Makefile.am << 'END'
-AUTOMAKE_OPTIONS = subdir-objects
-bin_PROGRAMS = foo
-foo_SOURCES = foo.c foo.h sub/subfoo.c
-END
-
-echo 'extern int subfoo (void);' > src/foo.h
-
-cat > src/foo.c << 'END'
-#include "foo.h"
-int main (void)
-{
-  return subfoo ();
-}
-END
-
-# We include subfoo only to be sure that we don't remove too much
-# from the object file name.
-cat > src/sub/subfoo.c << 'END'
-#include "foo.h"
-int subfoo (void)
-{
-  return 0;
-}
-END
-
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE -a
-
-# Sanity check: make sure the cache variable we force is used
-# by configure.
-grep am_cv_CC_dependencies_compiler_type configure \
-  || fatal_ "configure lacks required cache variable"
-
-cd "$ocwd" || fatal_ "cannot chdir back to top directory"
-
-longpath=this-is/a-path/which-have/quite-a/long_long_name
-$srctree/install-sh -d $longpath || fatal_ "cannot create long path"
-cp -pR $srctree/* $longpath || fatal_ "cannot populate long path"
-cp -pR $srctree/* . || fatal_ "cannot populate top-level directory"
-
-for vpath in simple long absolute; do
-  for depmode in $tested_depmodes; do
-    case $vpath in
-      simple)
-        srcdir=..;;
-      long)
-        srcdir=../$longpath;;
-      absolute)
-        srcdir=$ocwd;;
-      *)
-        fatal_ "bad \$vpath value '$vpath'";;
-    esac
-
-    pfx="$depmode [$vpath VPATH]"
-
-    mkdir $depmode-$vpath.d
-    cd $depmode-$vpath.d
-
-    if "$srcdir"/configure am_cv_CC_dependencies_compiler_type=$depmode
-    then
-      r0='ok'
-    else
-      r0='not ok'
-    fi
-    result_ "$r0" "$pfx configure" \
-
-    # Do not fail with the first call to make fails, as the depmode
-    # we've forced might not actually work, but we have overridden the
-    # _AM_DEPENDENCIES tests.
-    r1='not ok'
-    if $MAKE; then
-      # We must clean and rebuild, as the actual error only happens the
-      # second time the objects are built because 'depcomp' has silently
-      # messed up the .Po files the first time.
-      $MAKE clean \
-        && { e=0; $MAKE >output 2>&1 || e=1; cat output; test $e -eq 0; } \
-        && { if grep 'src/[._]deps' output; then false; else :; fi; } \
-        && r1='ok'
-      result_ "$r1" "$pfx make & remake"
-    else
-      skip_ -r "can't force depmode" "$pfx make & remake"
-    fi
-
-    cd "$ocwd" || fatal_ "cannot chdir back to top directory"
-
-    # Remove subdirectories for tests that have passed, to avoid ending up
-    # with a too big test directory.  This is especially important since,
-    # on each and every system, at least some tests in this script are
-    # expected to be skipped (which ones exactly depends on the system),
-    # thus causing the test directory not to be removed when the script
-    # terminates.
-    if not am_keeping_testdirs && test "$r0,$r1" = ok,ok; then
-      rm_rf_ $depmode-$vpath.d \
-        || fatal_ "removing directory \`$depmode-$vpath.d'"
-    else
-      : For lesser shells with broken 'set -e'.
-    fi
-
-  done
-done
-
-:
diff --git a/tests/exeext4.test b/tests/exeext4.test
index 1ee8016..9ce25fe 100755
--- a/tests/exeext4.test
+++ b/tests/exeext4.test
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 2003, 2006, 2010, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006, 2010, 2011, 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
@@ -17,18 +18,18 @@
 # Make sure $(EXEEXT) is appended to programs and to tests that are
 # programs, but not to @address@hidden
 
-required=cc
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
 AM_CONDITIONAL([COND], [test -n "$cond"])
 AC_SUBST([programs], ['prg1$(EXEEXT) prg2$(EXEEXT)'])
-AC_PROG_CC
+AC_SUBST([CC], [whocares])
 AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
-EXEEXT = .bin
+AUTOMAKE_OPTIONS = no-dependencies
+EXEEXT = .x
 if COND
   BAR = bar
   DEP = bar
@@ -39,42 +40,31 @@ bin_PROGRAMS = $(programs) @programs@ prg3 $(BAR) $(BAZE)
 EXTRA_PROGRAMS = prg1 prg2 prg3
 TESTS = prg1 prg3 prg4 $(BAZ)
 
-print-bin:
-       @echo BEG: $(bin_PROGRAMS) :END
-print-extra:
-       @echo BEG: $(EXTRA_PROGRAMS) :END
-print-tests:
-       @echo BEG: $(TESTS) :END
-print-barbaz:
-       @echo BEG: $(BAR) $(BAZ) :END
+.PHONY: test-cond test-nocond
+test-nocond:
+       is $(bin_PROGRAMS) == prg1.x prg2.x prg1.x prg2.x prg3.x
+       is $(EXTRA_PROGRAMS) == prg1.x prg2.x prg3.x
+       is $(TESTS) == prg1.x prg3.x prg4
+test-cond:
+       is $(bin_PROGRAMS) == prg1.x prg2.x prg1.x prg2.x prg3.x bar.x baz.x
+       is $(EXTRA_PROGRAMS) == prg1.x prg2.x prg3.x
+       is $(TESTS) == prg1.x prg3.x prg4 baz.x bar.x
+       is $(BAR) $(BAZ) == bar baz bar
 END
 
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing --copy
+
 ./configure
-$MAKE print-bin > output
-cat output
-$FGREP 'prg1.bin prg2.bin prg1.bin prg2.bin prg3.bin' output
-$MAKE print-extra > output
-cat output
-$FGREP 'prg1.bin prg2.bin prg3.bin' output
-$MAKE print-tests > output
-cat output
-$FGREP 'prg1.bin prg3.bin prg4' output
+$MAKE test-nocond
 
 ./configure cond=yes
-$MAKE print-bin > output
-cat output
-$FGREP 'prg1.bin prg2.bin prg1.bin prg2.bin prg3.bin bar.bin baz.bin' output
-$MAKE print-tests > output
-cat output
-$FGREP 'prg1.bin prg3.bin prg4 baz.bin bar.bin' output
-$MAKE print-barbaz > output
-cat output
-$FGREP 'bar baz bar' output
+$MAKE test-cond
 
 # Only two am__EXEEXT_* variables are needed here: one for BAR, and one
 # BAZ.  The latter must use the former.
 test 2 = `grep '__EXEEXT_. =' Makefile.in | wc -l`
 grep 'am__EXEEXT_2 = .*am__EXEEXT_1' Makefile.in
+
+:
diff --git a/tests/gen-testsuite-part b/tests/gen-testsuite-part
index 51b634f..40e6dfc 100755
--- a/tests/gen-testsuite-part
+++ b/tests/gen-testsuite-part
@@ -23,6 +23,8 @@
 use warnings FATAL => "all";
 use strict;
 use File::Basename ();
+use constant TRUE => 1;
+use constant FALSE => 0;
 
 my $me = File::Basename::basename $0;
 
@@ -173,6 +175,11 @@ my %deps_extractor =
         dist_prereqs => "tap-setup.sh",
         nodist_prereqs => "tap-common-setup.log",
       },
+    depcomp =>
+      {
+        line_matcher => qr/\bdepcomp\.sh\b/,
+        dist_prereqs => "depcomp.sh",
+      },
   );
 
 #--------------------------------------------------------------------------
@@ -267,8 +274,6 @@ print <<EOF;
 ##  Autogenerated tests and their dependencies.  ##
 ## --------------------------------------------- ##
 
-generated_TESTS =
-
 EOF
 
 # FIXME: the following is not really right, since cannot compose wrapping
@@ -292,8 +297,6 @@ while (my ($k, $g) = each %test_generators)
                      sub { write_wrapper_script $_[0], $wrapped_test,
                            $g->{shell_setup_code} },
                      0555;
-        # Update generated makefile fragment to account for it.
-        print "generated_TESTS += $wrapper_test\n";
         # The generated test works by sourcing the original test, so that
         # it has to be re-run every time that changes ...
         print "$base-w.log: $wrapped_test\n";
@@ -307,6 +310,67 @@ while (my ($k, $g) = each %test_generators)
       }
   }
 
+print <<EOF;
+
+## ---------------------------------------------------- ##
+##  Ad-hoc autogenerated tests and their dependencies.  ##
+## ---------------------------------------------------- ##
+
+EOF
+
+print "## Tests on automatic dependency tracking (see 'depcomp.sh').\n";
+
+# Key: depmode, value: list of required programs.
+my %depmodes =
+  (
+    auto         => ["cc"],
+    disabled     => ["cc"],
+    makedepend   => ["cc", "makedepend"],
+    dashmstdout  => ["gcc"],
+    dashXmstdout => ["gcc"],
+    cpp          => ["gcc"],
+# This is for older (pre-3.x) GCC versions.  Newer versions
+# have depmode "gcc3".
+    gcc          => ["gcc"],
+  );
+
+foreach my $lt (TRUE, FALSE)
+  {
+    foreach my $m (keys %depmodes)
+      {
+        my @required =
+          (
+            @{$depmodes{$m}},
+            $lt ? ("libtoolize",) : (),
+          );
+        my @vars_init =
+          (
+            "depmode=$m",
+            "depcomp_with_libtool=" . ($lt ? "yes" : "no"),
+          );
+        my $base = "depcomp" . ($lt ? "-lt-" : "-") . $m;
+        # Register wrapper test as "autogenerated" ...
+        push @generated_tests, "$base.tap";
+        atomic_write ("$base.tap", sub
+          {
+            my $file_handle = shift;
+            print $file_handle unindent <<EOF;
+              #! /bin/sh
+              # Automatically generated test.  DO NOT EDIT BY HAND!
+              @vars_init
+              required="@required"
+              . ./defs-static || exit '99'
+              . "\$testsrcdir/depcomp.sh"; exit "\$?"
+EOF
+          },
+          0555);
+      }
+   }
+
+# Update generated makefile fragment to account for all the generated tests.
+print "generated_TESTS =\n";
+map { print "generated_TESTS += $_\n" } @generated_tests;
+
 # The test scripts are scanned for automatic dependency generation *after*
 # the generated tests have been created, so they too can be scanned.  To
 # do so correctly, we need to update the list in address@hidden' to make it
diff --git a/tests/is b/tests/is
new file mode 100755
index 0000000..1e1c0ce
--- /dev/null
+++ b/tests/is
@@ -0,0 +1,54 @@
+#! /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/>.
+
+# Test that two whitespace-separated lists are equal.
+# Assumes the two lists are passed on the command line separated by
+# a '==' string.
+# This script is useful to test equality of lists in makefile rules,
+# in the face of variables defined through line-continuations,
+# automake rewrites and expansions of empty variables.
+
+set -e
+set -u
+
+# Initialize before unsetting, for shells (like older bash or Solaris
+# ksh) that fail to unset variables that are already unset.
+exp= got=; unset exp got
+seen_eqeq=no
+while test $# -gt 0; do
+  if test x"$1" = x"=="; then
+    if test $seen_eqeq = no; then
+      seen_eqeq=yes
+    else
+      echo "$0: more than one '==' argument seen on command line" >&2
+      exit 2
+    fi
+  else
+    if test $seen_eqeq = no; then
+      got=${got+"$got "}$1
+    else
+      exp=${exp+"$exp "}$1
+    fi
+  fi
+  shift
+done
+
+if test $seen_eqeq = no; then
+  echo "$0: no '==' argument seen on command line" >&2
+  exit 2
+fi
+
+test x"${exp-}" = x"${got-}"
diff --git a/tests/list-of-tests.mk b/tests/list-of-tests.mk
index f3cb769..47eb5bc 100644
--- a/tests/list-of-tests.mk
+++ b/tests/list-of-tests.mk
@@ -39,7 +39,6 @@ pm/Wrap.pl
 handwritten_TESTS = \
 get-sysconf.test \
 $(perl_TESTS) \
-depmod.tap \
 instspc.tap \
 aclocal.test \
 aclocal3.test \
@@ -325,16 +324,10 @@ deleted-m4.test \
 depacl2.test \
 depcomp.test \
 depcomp2.test \
-depcomp3.test \
-depcomp4.test \
-depcomp5.test \
-depcomp6.test \
-depcomp7.test \
 depcomp8a.test \
 depcomp8b.test \
 depdist.test \
 depend.test \
-depend2.test \
 depend3.test \
 depend4.test \
 depend5.test \
diff --git a/tests/objext-pr10128.test b/tests/objext-pr10128.test
index 120986c..e105635 100755
--- a/tests/objext-pr10128.test
+++ b/tests/objext-pr10128.test
@@ -38,8 +38,8 @@ zardoz_SOURCES = mu1.lisp mu2.lisp
 
 .PHONY: test
 test:
-       test '$(foo_OBJECTS)'    = 'foo.fasl'
-       test '$(zardoz_OBJECTS)' = 'mu1.fasl mu2.fasl'
+       is $(foo_OBJECTS) == foo.fasl
+       is $(zardoz_OBJECTS) == mu1.fasl mu2.fasl
 END
 
 $ACLOCAL
diff --git a/tests/programs-primary-rewritten.test 
b/tests/programs-primary-rewritten.test
index e52bd56..2328bb6 100755
--- a/tests/programs-primary-rewritten.test
+++ b/tests/programs-primary-rewritten.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003, 2006, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006, 2011, 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
@@ -40,9 +40,9 @@ baz = mau
 
 .PHONY: test
 test:
-       test '$(check_PROGRAMS)' = a.bin
-       test '$(bin_PROGRAMS)' = 'b.bin c'
-       test '$(noinst_PROGRAMS)' = 'zardoz.bin maude.bin'
+       is $(check_PROGRAMS) == a.bin
+       is $(bin_PROGRAMS) == b.bin c
+       is $(noinst_PROGRAMS) == zardoz.bin maude.bin
 END
 
 $ACLOCAL
diff --git a/tests/substre2.test b/tests/substre2.test
index ec92062..1935622 100755
--- a/tests/substre2.test
+++ b/tests/substre2.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003, 2010, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2010, 2011, 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
@@ -17,15 +17,15 @@
 # Test for bug in variable substitution references, where
 # undefined variables break later substitutions.
 
-required=cc
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
-AC_PROG_CC
+AC_SUBST([CC], [whocares])
 AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = no-dependencies
 
 foo = foo.a foo.b $(doesnt_exist)
 bar = bar.a bar.b
@@ -36,16 +36,15 @@ bin_PROGRAMS = foo
 foo_SOURCES = $(var2)
 
 OBJEXT = obj
-echorule:
-       @echo BEG: $(foo_OBJECTS) :END
+.PHONY: test
+test:
+       is $(foo_OBJECTS) == foo1.obj foo4.obj bar3.obj bar4.obj
 END
 
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
 ./configure
-$MAKE echorule >output || { cat output; Exit 1; }
-cat output
-$FGREP 'BEG: foo1.obj foo4.obj bar3.obj bar4.obj :END' output
+$MAKE test
 
 :
diff --git a/tests/substref.test b/tests/substref.test
index 7b30423..a3088b0 100755
--- a/tests/substref.test
+++ b/tests/substref.test
@@ -18,24 +18,24 @@
 # pattern is null.
 # Report from Richard Boulton.
 
-required=cc
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
-AC_PROG_CC
+AC_SUBST([CC], [whocares])
 AC_OUTPUT
 END
 
-cat > hello.c << 'END'
-END
+: > hello.c
 
 cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = no-dependencies
 var1 = dlmain
 var2 = $(var1:=.)
 helldl_SOURCES = $(var2:=c)
 bin_PROGRAMS = helldl
-got:
-       @echo $(helldl_SOURCES) $(helldl_OBJECTS) >got
+.PHONY: test
+test:
+       is $(helldl_SOURCES) $(helldl_OBJECTS) == dlmain.c dlmain.$(OBJEXT)
 END
 
 $ACLOCAL
@@ -43,12 +43,7 @@ $AUTOCONF
 $AUTOMAKE -a
 
 ./configure
-
-objext=`sed -n -e 's/^OBJEXT = //p' < Makefile`
-echo dlmain.c dlmain.$objext >exp
-$MAKE got
-cat got
-diff exp got
+$MAKE test
 
 # This is unrelated to the rest of this test.  But while we are
 # at it, make sure we don't use am__helldl_SOURCES_DIST here, since
diff --git a/tests/test-logs-repeated.test b/tests/test-logs-repeated.test
index 5ab3461..0bec579 100755
--- a/tests/test-logs-repeated.test
+++ b/tests/test-logs-repeated.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2011 Free Software Foundation, Inc.
+# Copyright (C) 2011, 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
@@ -32,7 +32,7 @@ TEST_EXTENSIONS = .sh .test .bar
 TESTS = foo.sh mu.test foo.test foo.bar
 .PHONY: verify
 verify:
-       test "`echo $(TEST_LOGS)`" = 'foo.log mu.log foo.log foo.log'
+       is $(TEST_LOGS) == foo.log mu.log foo.log foo.log
 END
 
 $ACLOCAL


hooks/post-receive
-- 
GNU Automake



reply via email to

[Prev in Thread] Current Thread [Next in Thread]