subdir-keep-going-pr12554.sh 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #! /bin/sh
  2. # Copyright (C) 2013-2017 Free Software Foundation, Inc.
  3. #
  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.
  8. #
  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.
  13. #
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. # Check that the Automake-generated recursive rules are resilient against
  17. # false positives in deciding whether make is running with the '-k'
  18. # option, and thus whether a failure into one of the $(SUBDIRS) should
  19. # still prevent recursion in the following $(SUBDIRS) entries. See
  20. # automake bug#12544.
  21. . test-init.sh
  22. echo nil: | $MAKE -I . -f - || skip_ "$MAKE doesn't support the -I option"
  23. cat >> configure.ac <<'END'
  24. AC_CONFIG_FILES([sub1/Makefile sub2/Makefile])
  25. AC_OUTPUT
  26. END
  27. mkdir k ./--keep-going sub1 sub2
  28. cat > Makefile.am <<'END'
  29. SUBDIRS = sub1 sub2
  30. END
  31. cat > sub1/Makefile.am <<'END'
  32. all-local:
  33. touch ko
  34. false
  35. END
  36. cat > sub2/Makefile.am <<'END'
  37. all-local:
  38. test -f ../sub1/ko
  39. touch ok
  40. END
  41. $ACLOCAL
  42. $AUTOCONF
  43. $AUTOMAKE
  44. ./configure
  45. st=0
  46. $MAKE -I k -I --keep-going \
  47. TESTS='k --keep-going -k' AM_MAKEFLAGS="TESTS='k --keep-going -k'" \
  48. || st=$?
  49. # Don't trust the exit status of "make -k" for non-GNU make.
  50. if using_gmake; then
  51. test $st -gt 0 || exit 1
  52. fi
  53. test ! -r sub2/ok
  54. # Sanity check.
  55. st=0; $MAKE -k || st=$?
  56. if { using_gmake && test $st -eq 0; } || test ! -f sub2/ok; then
  57. fatal_ '"make -k" not working as expected'
  58. fi
  59. :