check4.sh 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #! /bin/sh
  2. # Copyright (C) 2005-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. # Make sure 'make -k check' processes all directories.
  17. # For gen-testsuite-part: ==> try-with-serial-tests <==
  18. . test-init.sh
  19. cat >> configure.ac << 'END'
  20. AC_CONFIG_FILES([dir/Makefile])
  21. AC_OUTPUT
  22. END
  23. mkdir dir
  24. cat > Makefile.am <<'END'
  25. SUBDIRS = dir
  26. TESTS = ok.sh
  27. END
  28. echo TESTS = fail.sh >dir/Makefile.am
  29. cat >ok.sh <<'END'
  30. #!/bin/sh
  31. :
  32. END
  33. cat >dir/fail.sh <<'END'
  34. #!/bin/sh
  35. exit 1
  36. END
  37. chmod +x ok.sh dir/fail.sh
  38. $ACLOCAL
  39. $AUTOCONF
  40. $AUTOMAKE --add-missing
  41. ./configure --prefix "$(pwd)/inst"
  42. run_make -O -e FAIL -- check
  43. grep '^FAIL: fail\.sh *$' stdout
  44. grep '^PASS: ok\.sh *$' stdout && exit 1
  45. # The exit status of 'make -k' can be anything
  46. # (depending on the Make implementation)
  47. run_make -O -e IGNORE -- -k check
  48. grep '^FAIL: fail\.sh *$' stdout
  49. grep '^PASS: ok\.sh *$' stdout
  50. # Should also works when -k is not in first position.
  51. run_make -O -e IGNORE -- -s -k check
  52. grep '^FAIL: fail\.sh *' stdout
  53. grep '^PASS: ok\.sh *' stdout
  54. # The rest of the test is for GNU Make.
  55. if using_gmake; then
  56. # Try with a long-option that do not have a short option equivalent
  57. # (here, --no-print-directory). That should cause all options to
  58. # appear verbatim in MAKEFLAGS.
  59. run_make -e FAIL -O -- --no-print-directory -k check
  60. grep '^FAIL: fail\.sh *$' stdout
  61. grep '^PASS: ok\.sh *$' stdout
  62. fi
  63. :