parallel-tests-concurrency-2.sh 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. # - concurrent program compilation and testing (with EXTRA_PROGRAMS)
  18. #
  19. # Actually, this test doesn't ensure that things happen concurrently.
  20. # It merely serves as demonstration. :-)
  21. required='cc native GNUmake'
  22. . test-init.sh
  23. cat >> configure.ac << 'END'
  24. AC_PROG_CC
  25. AC_OUTPUT
  26. END
  27. cat > Makefile.am << 'END'
  28. TESTS = $(programs) $(scripts)
  29. EXTRA_PROGRAMS = $(programs)
  30. CLEANFILES = $(EXTRA_PROGRAMS)
  31. dist_noinst_SCRIPTS = $(scripts)
  32. programs =
  33. scripts =
  34. END
  35. for i in 1 2 3 4 5 6 7 8; do
  36. echo "scripts += foo$i.test" >> Makefile.am
  37. echo "programs += foo$i.prog" >> Makefile.am
  38. unindent >foo$i.test <<'END'
  39. #! /bin/sh
  40. echo "this is $0"
  41. exit 0
  42. END
  43. cat >foo$i.c <<'END'
  44. int main (void)
  45. {
  46. return 0;
  47. }
  48. END
  49. chmod a+x foo$i.test
  50. done
  51. $ACLOCAL
  52. $AUTOCONF
  53. $AUTOMAKE -a
  54. ./configure
  55. $MAKE -j4 check
  56. $MAKE distcheck
  57. :