check7.sh 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #! /bin/sh
  2. # Copyright (C) 2007-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 EXEEXT extension for XFAIL_TESTS.
  17. # For gen-testsuite-part: ==> try-with-serial-tests <==
  18. required=cc
  19. . test-init.sh
  20. cat >> configure.ac << 'END'
  21. AC_PROG_CC
  22. AC_OUTPUT
  23. END
  24. cat > Makefile.am << 'END'
  25. TESTS = $(XFAIL_TESTS)
  26. XFAIL_TESTS = a b c d
  27. check_PROGRAMS = a c d
  28. check_SCRIPTS = b
  29. EXTRA_DIST = $(check_SCRIPTS)
  30. expect-xfail-tests:
  31. is $(XFAIL_TESTS) == a$(EXEEXT) b c$(EXEEXT) d$(EXEEXT)
  32. END
  33. cat > b <<'END'
  34. #! /bin/sh
  35. exit 1
  36. END
  37. chmod a+x b
  38. cat > a.c <<'END'
  39. #include <stdlib.h>
  40. int main (void)
  41. {
  42. return EXIT_FAILURE;
  43. }
  44. END
  45. cp a.c c.c
  46. cp a.c d.c
  47. $ACLOCAL
  48. $AUTOCONF
  49. $AUTOMAKE -a
  50. ./configure
  51. $MAKE check
  52. run_make expect-xfail-tests
  53. run_make expect-xfail-tests EXEEXT=.bin
  54. $MAKE distcheck
  55. :