subdirs: don't return false positives for the '-k' option's presence
authorStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 29 Apr 2013 14:12:34 +0000 (16:12 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 29 Apr 2013 17:55:22 +0000 (19:55 +0200)
commit02ead48eb3043b1cfa9eb8072d8270cf5cc66c84
treeab16d1f4c3c72153e9f215b3726c8d2c69e74f20
parent69f7791509c523fe8b199a432b72dca6a5ce3caa
subdirs: don't return false positives for the '-k' option's presence

This change fixes automake bug#12554.

The old implementation of the code descending into $(SUBDIRS)
entries used the following snippet to decide whether make is running
with the '-k' a.k.a. '--keep-going' option, and thus whether a failure
in a subdirectory should prevent the descent in the following ones:

    fail= failcom='exit 1'; \
    for f in x $$MAKEFLAGS; do \
      case $$f in \
        *=* | --[!k]*);; \
        *k*) failcom='fail=yes';; \
      esac; \
    done

It's clear that the second pattern in the 'case' construct could possibly
match false positives, for examples in these two cases:

    make check TESTS="x.test k.test"
    make -I /usr/local/kool-fragments

which are somewhat unusual, but not invalid.  So we need a more resilient
implementation, as we did for the detection of the '-n' flag.

This implementation is now provided by the new private macro
'$(am__make_keepgoing)' (introduced in recent commits); so we can
just us that to fix the bug.

* lib/am/subdirs.am ($(am__recursive_targets)): Use '$(am__make_keepgoing)'
instead of ad-hoc and more brittle checks.
* t/list-of-tests.mk (XFAIL_TESTS): Remove the now-passing test case
't/subdir-keep-going-pr12554.sh'.

Reported-by: Michael Daniels <mdaniels@rim.com>
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
lib/am/subdirs.am
t/list-of-tests.mk