parallel-tests-recheck-depends-on-all.sh 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #! /bin/sh
  2. # Copyright (C) 2012-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. # The parallel-tests 'recheck' target must depend on the 'all' target.
  17. # See automake bug#11252.
  18. required='cc native'
  19. . test-init.sh
  20. cat >> configure.ac << 'END'
  21. AC_PROG_CC
  22. AC_OUTPUT
  23. END
  24. cat > Makefile.am << 'END'
  25. all-local:
  26. test ! -f status || echo okokok > status
  27. bin_PROGRAMS = foo
  28. TESTS = a.test b.test c.test
  29. END
  30. cat > foo.c << 'END'
  31. #include <stdio.h>
  32. int main (void)
  33. {
  34. printf ("failure :-(" "\n");
  35. return 1;
  36. }
  37. END
  38. cat > a.test << 'END'
  39. #!/bin/sh
  40. exit 0
  41. END
  42. cat > b.test << 'END'
  43. #!/bin/sh
  44. grep okokok status
  45. END
  46. cat > c.test << 'END'
  47. #!/bin/sh
  48. ./foo
  49. END
  50. chmod a+x *.test
  51. $ACLOCAL
  52. $AUTOCONF
  53. $AUTOMAKE -a
  54. ./configure
  55. run_make -O -e FAIL check
  56. count_test_results total=3 pass=1 fail=2 skip=0 xfail=0 xpass=0 error=0
  57. test ! -e status
  58. $sleep
  59. : > status
  60. cat > foo.c << 'END'
  61. #include <stdio.h>
  62. int main (void)
  63. {
  64. printf ("success :-)" "\n");
  65. return 0;
  66. }
  67. END
  68. run_make -O recheck
  69. count_test_results total=2 pass=2 fail=0 skip=0 xfail=0 xpass=0 error=0
  70. grep '^PASS: b\.test$' stdout
  71. grep '^PASS: c\.test$' stdout
  72. run_make -O recheck
  73. count_test_results total=0 pass=0 fail=0 skip=0 xfail=0 xpass=0 error=0
  74. :