parallel-tests-generated-and-distributed.sh 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #! /bin/sh
  2. # Copyright (C) 2009-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 parallel-tests features:
  17. # - generated distributed tests.
  18. # - listing $(srcdir)/ or $(top_srcdir)/ in TESTS doesn't work ATM,
  19. # and is thus diagnosed.
  20. # TODO: this test should also ensure that the 'make' implementation
  21. # properly adheres to rules in all cases. See the Autoconf
  22. # manual for the ugliness in this area, when VPATH comes into
  23. # play. :-/
  24. . test-init.sh
  25. cat >> configure.ac << 'END'
  26. AC_OUTPUT
  27. END
  28. cat > Makefile.am << 'END'
  29. TESTS = foo.test
  30. ## the next line will cause automake to error out:
  31. TESTS += $(srcdir)/bar.test $(top_srcdir)/baz.test
  32. .in.test:
  33. ## Account for VPATH issues on weaker make implementations (e.g. IRIX 6.5)
  34. cp `test -f '$<' || echo $(srcdir)/`$< $@
  35. chmod +x $@
  36. check_SCRIPTS = $(TESTS)
  37. EXTRA_DIST = foo.in foo.test
  38. DISTCLEANFILES = foo.test
  39. END
  40. cat > foo.in <<'END'
  41. #! /bin/sh
  42. echo "this is $0"
  43. exit 0
  44. END
  45. $ACLOCAL
  46. $AUTOCONF
  47. AUTOMAKE_fails -a
  48. grep '$(srcdir).*TESTS.*bar\.test' stderr
  49. grep '$(top_srcdir).*TESTS.*baz\.test' stderr
  50. sed '/^TESTS +=.*srcdir/d' < Makefile.am > t
  51. mv -f t Makefile.am
  52. $AUTOMAKE -a
  53. ./configure
  54. $MAKE check
  55. $MAKE distcheck
  56. $MAKE distclean
  57. mkdir build
  58. cd build
  59. ../configure
  60. $MAKE check
  61. test ! -e ../foo.log
  62. $MAKE distcheck
  63. :