dejagnu-siteexp-useredit.sh 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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 user can edit the Makefile-generated site.exp, and
  17. # have its edits survive to the remaking of that file.
  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 = foo
  25. END
  26. # Deliberately select a variable defined automatically by
  27. # the Makefile-generated site.exp.
  28. mkdir foo.test
  29. cat > foo.test/foo.exp << 'END'
  30. send_user "objdir: $objdir\n"
  31. set pipe "|"
  32. if { $objdir == "${pipe}objdir${pipe}" } {
  33. pass "test_obj"
  34. } else {
  35. fail "test_obj"
  36. }
  37. END
  38. $ACLOCAL
  39. $AUTOCONF
  40. $AUTOMAKE --add-missing
  41. ./configure
  42. $MAKE site.exp
  43. echo 'set objdir "|objdir|"' >> site.exp
  44. cat site.exp
  45. $sleep
  46. touch Makefile
  47. $MAKE site.exp
  48. cat site.exp
  49. is_newest site.exp Makefile # Sanity check.
  50. grep '|objdir|' site.exp
  51. test $($FGREP -c '|objdir|' site.exp) -eq 1
  52. # We can do a "more semantic" check if DejaGnu is available.
  53. if runtest SOMEPROGRAM=someprogram --version; then
  54. $MAKE check
  55. grep 'PASS: test_obj' foo.sum
  56. fi
  57. :