dejagnu7.sh 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #! /bin/sh
  2. # Copyright (C) 2003-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 "make check" fails, when we invoke DejaGnu tests with --status
  17. # (to detect TCL errors) on a file with TCL errors.
  18. required=runtest
  19. . test-init.sh
  20. runtest --help | grep '.*--status' \
  21. || skip_ "dejagnu lacks support for '--status'"
  22. cat > failtcl << 'END'
  23. #! /bin/sh
  24. echo whatever
  25. END
  26. chmod +x failtcl
  27. cat >> configure.ac << 'END'
  28. AC_OUTPUT
  29. END
  30. cat > Makefile.am << 'END'
  31. AUTOMAKE_OPTIONS = dejagnu
  32. DEJATOOL = failtcl
  33. AM_RUNTESTFLAGS = --status FAILTCL=$(srcdir)/failtcl
  34. END
  35. mkdir failtcl.test
  36. cat > failtcl.test/failtcl.exp << 'END'
  37. set test test
  38. spawn $FAILTCL
  39. expect {
  40. default { pass "$test" }
  41. # Oops, no closing brace.
  42. END
  43. $ACLOCAL
  44. $AUTOCONF
  45. $AUTOMAKE --add-missing
  46. ./configure
  47. $MAKE check && exit 1
  48. test -f failtcl.log
  49. test -f failtcl.sum
  50. $FGREP 'missing close-brace' failtcl.sum
  51. :