2
0

check-subst.sh 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #! /bin/sh
  2. # Copyright (C) 2008-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 @substituted@ TESTS.
  17. # Note that in this test, we rely on the .test extension for the
  18. # substituted names: this is necessary for the parallel harness.
  19. # See also sister test 'check-subst-prog.sh'.
  20. # For gen-testsuite-part: ==> try-with-serial-tests <==
  21. . test-init.sh
  22. cat >> configure.ac << 'END'
  23. AC_SUBST([script_tests], ['subst-pass-script.sh subst-xfail-script.sh'])
  24. AC_SUBST([xfail_tests], ['xfail-script.test subst-xfail-script.sh'])
  25. AC_OUTPUT
  26. END
  27. cat > Makefile.am << 'END'
  28. TESTS = pass-script.test xfail-script.test @script_tests@
  29. XFAIL_TESTS = @xfail_tests@
  30. END
  31. if test x"$am_serial_tests" != x"yes"; then
  32. unindent >> Makefile.am <<'END'
  33. TEST_EXTENSIONS = .sh .test
  34. SH_LOG_COMPILER = $(SHELL)
  35. END
  36. fi
  37. cat > pass-script.test <<'END'
  38. #! /bin/sh
  39. exit 0
  40. END
  41. cat > xfail-script.test <<'END'
  42. #! /bin/sh
  43. exit 1
  44. END
  45. cp pass-script.test subst-pass-script.sh
  46. cp xfail-script.test subst-xfail-script.sh
  47. chmod a+x pass-script.test xfail-script.test
  48. if test x"$am_serial_tests" = x"yes"; then
  49. chmod a+x subst-pass-script.sh subst-xfail-script.sh
  50. fi
  51. $ACLOCAL
  52. $AUTOCONF
  53. $AUTOMAKE -a
  54. for vpath in false : ; do
  55. if $vpath; then
  56. mkdir build
  57. cd build
  58. srcdir=..
  59. else
  60. srcdir=.
  61. fi
  62. $srcdir/configure
  63. $MAKE all
  64. $MAKE check
  65. if test x"$am_serial_tests" != x"yes"; then
  66. ls -l
  67. test -f pass-script.log
  68. test -f xfail-script.log
  69. test -f subst-pass-script.log
  70. test -f subst-xfail-script.log
  71. fi
  72. $MAKE distclean
  73. cd $srcdir
  74. done
  75. :