Hash :
cbf23ceb
Author :
Date :
2012-10-02T21:27:28
tests: expose bug#12554 (false positives for presence of '-k' make option)
The current implementation of the code descending into $(SUBDIRS)
entries uses 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 can 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.
But alas, such an implementation seems quite tricky to obtain in portable
make. So for the moment we content ourselves with exposing the bug, with
the hope of being able to fix soon enough.
* t/subdir-keep-going-pr12554.sh: New test.
* t/list-of-tests.mk (handwritten_TESTS, XFAIL_TESTS): Add it.
* THANKS: Update
Reported-by: Michael Daniels <mdaniels@rim.com>
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
#! /bin/sh
# Copyright (C) 2013 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 Automake-generated recursive rules are resilient against
# false positives in deciding whether make is running with the '-k'
# option, and thus whether a failure into one of the $(SUBDIRS) should
# still prevent recursion in the following $(SUBDIRS) entries. See
# automake bug#12544.
. test-init.sh
echo nil: | $MAKE -I . -f - || skip_ "$MAKE doesn't support the -I option"
cat >> configure.ac <<'END'
AC_CONFIG_FILES([sub1/Makefile sub2/Makefile])
AC_OUTPUT
END
mkdir k ./--keep-going sub1 sub2
cat > Makefile.am <<'END'
SUBDIRS = sub1 sub2
END
cat > sub1/Makefile.am <<'END'
all-local:
touch ko
false
END
cat > sub2/Makefile.am <<'END'
all-local:
test -f ../sub1/ko
touch ok
END
$ACLOCAL
$AUTOCONF
$AUTOMAKE
./configure
st=0
$MAKE -I k -I --keep-going \
TESTS='k --keep-going -k' AM_MAKEFLAGS="TESTS='k --keep-going -k'" \
|| st=$?
# Don't trust the exit status of "make -k" for non-GNU make.
if using_gmake; then
test $st -gt 0 || exit 1
fi
test ! -r sub2/ok
# Sanity check.
st=0; $MAKE -k || st=$?
if { using_gmake && test $st -eq 0; } || test ! -f sub2/ok; then
fatal_ '"make -k" not working as expected'
fi
: