dejagnu-siteexp-append.sh 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #! /bin/sh
  2. # Copyright (C) 2011-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 files in $(EXTRA_DEJAGNU_SITE_CONFIG) get appended to
  17. # site.exp in the same order in which they're listed in that variable.
  18. . test-init.sh
  19. cat >> configure.ac << 'END'
  20. AC_OUTPUT
  21. END
  22. cat > Makefile.am << 'END'
  23. AUTOMAKE_OPTIONS = dejagnu
  24. DEJATOOL = tool
  25. END
  26. $ACLOCAL
  27. $AUTOCONF
  28. $AUTOMAKE --add-missing
  29. ./configure
  30. $MAKE site.exp
  31. sed '/^##.*##$/d' site.exp > expected
  32. cat > foo.exp << 'END'
  33. foo1
  34. foo2
  35. foo3
  36. END
  37. cat foo.exp - >> expected << 'END'
  38. BAR 1
  39. # foo
  40. BAR 2
  41. END
  42. cat >> Makefile.am << 'END'
  43. EXTRA_DEJAGNU_SITE_CONFIG = foo.exp bar.exp
  44. bar.exp:
  45. @(echo 'BAR 1' && echo '# foo' && echo 'BAR 2') > $@
  46. END
  47. $AUTOMAKE Makefile
  48. ./config.status Makefile
  49. rm -f site.exp
  50. $MAKE site.exp
  51. sed '/^##.*##$/d' site.exp > obtained
  52. cat expected
  53. cat site.exp
  54. diff expected obtained
  55. :