parallel-am3.sh 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. # Test parallel automake execution.
  17. # This tests:
  18. # 3) normal automake output should be identical and ordered in the same way
  19. # with --add-missing, even with concurrent file requirements, and the
  20. # installation of aux files should be race-free.
  21. required=perl-threads
  22. . test-init.sh
  23. cat > configure.ac << 'END'
  24. AC_INIT([parallel-am], [1.0])
  25. AC_CONFIG_AUX_DIR([build-aux])
  26. AM_INIT_AUTOMAKE
  27. AC_PROG_CC
  28. AM_PATH_LISPDIR
  29. AM_PATH_PYTHON
  30. AC_CONFIG_FILES([Makefile])
  31. END
  32. cat > Makefile.am << 'END'
  33. SUBDIRS =
  34. END
  35. list='1 2 3'
  36. for i in $list; do
  37. echo "AC_CONFIG_FILES([sub$i/Makefile])" >> configure.ac
  38. echo "SUBDIRS += sub$i" >> Makefile.am
  39. mkdir sub$i
  40. unindent > sub$i/Makefile.am <<END
  41. python_PYTHON = foo$i.py
  42. lisp_LISP = foo$i.el
  43. bin_PROGRAMS = p$i
  44. END
  45. done
  46. rm -f install-sh missing depcomp
  47. mkdir build-aux
  48. $ACLOCAL
  49. # Generate expected output using the non-threaded code.
  50. unset AUTOMAKE_JOBS
  51. AUTOMAKE_run --add-missing
  52. mv stderr expected
  53. mv Makefile.in Makefile.in.exp
  54. AUTOMAKE_JOBS=3
  55. export AUTOMAKE_JOBS
  56. for run in 1 2 3 4 5 6 7; do
  57. rm -f build-aux/* sub*/Makefile.in
  58. AUTOMAKE_run --add-missing
  59. diff stderr expected
  60. diff Makefile.in Makefile.in.exp
  61. done
  62. :