2
0

parallel-am2.sh 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. # 4) warning and normal error output should be identical, in that duplicate
  19. # warnings should be omitted in the same way as without threads.
  20. required=perl-threads
  21. . test-init.sh
  22. mkdir sub
  23. cat > Makefile.am << 'END'
  24. AUTOMAKE_OPTIONS = subdir-objects
  25. bin_PROGRAMS = main
  26. main_SOURCES = sub/main.c
  27. SUBDIRS =
  28. END
  29. list='1 2 3'
  30. for i in $list; do
  31. echo "AC_CONFIG_FILES([sub$i/Makefile])" >> configure.ac
  32. echo "SUBDIRS += sub$i" >> Makefile.am
  33. mkdir sub$i sub$i/sub
  34. unindent > sub$i/Makefile.am << END
  35. AUTOMAKE_OPTIONS = subdir-objects
  36. bin_PROGRAMS = sub$i
  37. sub${i}_SOURCES = sub/main$i.c
  38. END
  39. done
  40. mkdir build-aux
  41. $ACLOCAL
  42. # Independently of the number of worker threads, automake output
  43. # should be
  44. # - stable (multiple runs should produce the same output),
  45. # - properly uniquified,
  46. # - complete (output from worker threads should not be lost).
  47. #
  48. # The parts output by --add-missing are unstable not only wrt. order
  49. # but also wrt. content: any of the Makefile.am files may cause the
  50. # depcomp script to be installed (or several of them).
  51. # Thus we install the auxiliary files in a prior step.
  52. # Generate expected output using non-threaded code.
  53. unset AUTOMAKE_JOBS
  54. rm -f install-sh missing depcomp
  55. AUTOMAKE_fails --add-missing
  56. mv stderr expected
  57. AUTOMAKE_JOBS=5
  58. export AUTOMAKE_JOBS
  59. for i in 1 2 3 4 5 6 7 8; do
  60. rm -f install-sh missing depcomp
  61. AUTOMAKE_fails --add-missing
  62. diff expected stderr
  63. done
  64. :