Merge branch 'minor'
[automake.git] / t / subdir-keep-going-pr12554.sh
blob643e7886ad97711a41fac2857d8e94dc3f6c75eb
1 #! /bin/sh
2 # Copyright (C) 2013-2017 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
7 # any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <https://www.gnu.org/licenses/>.
17 # Check that the Automake-generated recursive rules are resilient against
18 # false positives in deciding whether make is running with the '-k'
19 # option, and thus whether a failure into one of the $(SUBDIRS) should
20 # still prevent recursion in the following $(SUBDIRS) entries. See
21 # automake bug#12544.
23 . test-init.sh
25 echo nil: | $MAKE -I . -f - || skip_ "$MAKE doesn't support the -I option"
27 cat >> configure.ac <<'END'
28 AC_CONFIG_FILES([sub1/Makefile sub2/Makefile])
29 AC_OUTPUT
30 END
32 mkdir k ./--keep-going sub1 sub2
34 cat > Makefile.am <<'END'
35 SUBDIRS = sub1 sub2
36 END
38 cat > sub1/Makefile.am <<'END'
39 all-local:
40 touch ko
41 false
42 END
43 cat > sub2/Makefile.am <<'END'
44 all-local:
45 test -f ../sub1/ko
46 touch ok
47 END
49 $ACLOCAL
50 $AUTOCONF
51 $AUTOMAKE
52 ./configure
54 st=0
55 $MAKE -I k -I --keep-going \
56 TESTS='k --keep-going -k' AM_MAKEFLAGS="TESTS='k --keep-going -k'" \
57 || st=$?
58 # Don't trust the exit status of "make -k" for non-GNU make.
59 if using_gmake; then
60 test $st -gt 0 || exit 1
62 test ! -r sub2/ok
64 # Sanity check.
65 st=0; $MAKE -k || st=$?
66 if { using_gmake && test $st -eq 0; } || test ! -f sub2/ok; then
67 fatal_ '"make -k" not working as expected'