tests: improve and rework tests on dependency tracking
authorStefano Lattarini <stefano.lattarini@gmail.com>
Fri, 3 Feb 2012 14:05:48 +0000 (15:05 +0100)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Wed, 8 Feb 2012 09:01:36 +0000 (10:01 +0100)
commit5066c1b5019b7de419a7b4703c26cb79ee9c713d
tree7d81fabcfec6576713aa9e8767474465b10e9aec
parentdec3c38232bb9006f02c6ca2a04d62e8f5b01125
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.
.gitignore
tests/depcomp.sh [new file with mode: 0755]
tests/depcomp3.test [deleted file]
tests/depcomp4.test [deleted file]
tests/depcomp5.test [deleted file]
tests/depcomp6.test [deleted file]
tests/depcomp7.test [deleted file]
tests/depend2.test [deleted file]
tests/depmod.tap [deleted file]
tests/gen-testsuite-part
tests/list-of-tests.mk