parallel-tests-suffix-prog.sh 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. # - suffix rules, with PROGRAMS involved
  18. # See also sister test 'parallel-tests-suffix.sh'.
  19. required='cc native'
  20. . test-init.sh
  21. cat >> configure.ac << 'END'
  22. AC_PROG_CC
  23. AC_OUTPUT
  24. END
  25. cat > Makefile.am << 'END'
  26. AUTOMAKE_OPTIONS = subdir-objects
  27. ## Note that automake should not match the '/test' part of 'sub/test' as
  28. ## '.test' suffix, nor the '/chk' part of 'sub/chk' as '.chk' suffix.
  29. TESTS = $(dist_TESTS) $(check_PROGRAMS)
  30. dist_TESTS = foo.chk bar.test sub/test
  31. check_PROGRAMS = baz bla.test bli.suff sub/chk
  32. TEST_EXTENSIONS = .chk .test
  33. EXTRA_DIST = $(dist_TESTS)
  34. END
  35. mkdir sub
  36. cat >foo.chk << 'END'
  37. #! /bin/sh
  38. exit 0
  39. END
  40. chmod a+x foo.chk
  41. cp foo.chk bar.test
  42. cp foo.chk sub/test
  43. cat >baz.c << 'END'
  44. int main (void)
  45. {
  46. return 0;
  47. }
  48. END
  49. cp baz.c bla.c
  50. cp baz.c bli.c
  51. cp baz.c sub/chk.c
  52. $ACLOCAL
  53. $AUTOCONF
  54. $AUTOMAKE -a
  55. ./configure
  56. $MAKE check
  57. ls -l . sub
  58. test -f foo.log
  59. test -f bar.log
  60. test -f baz.log
  61. test -f bla.log
  62. test -f bli.suff.log
  63. test -f sub/chk.log
  64. test -f sub/test.log
  65. $MAKE distcheck
  66. :