2
0

parallel-tests-no-spurious-summary.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 that ':test-results:' directives in test scripts' output doesn't
  17. # originate spurious results in the testsuite summary.
  18. . test-init.sh
  19. cat >> configure.ac << 'END'
  20. AC_OUTPUT
  21. END
  22. cat > Makefile.am << 'END'
  23. TESTS = foo.test bar.test
  24. END
  25. cat > foo.test <<'END'
  26. #! /bin/sh
  27. echo :test-result:XFAIL
  28. echo :test-result: SKIP
  29. echo :test-result:ERROR
  30. exit 0
  31. END
  32. cat > bar.test <<'END'
  33. #! /bin/sh
  34. echo :test-result: ERROR
  35. echo :test-result:FAIL
  36. echo :test-result: XPASS
  37. exit 0
  38. END
  39. chmod a+x foo.test bar.test
  40. $ACLOCAL
  41. $AUTOCONF
  42. $AUTOMAKE -a
  43. ./configure
  44. run_make -O -e IGNORE check
  45. cat test-suite.log
  46. cat foo.log
  47. cat bar.log
  48. test $am_make_rc -eq 0
  49. grep '^:test-result:XFAIL$' foo.log
  50. grep '^:test-result: SKIP$' foo.log
  51. grep '^:test-result:FAIL$' bar.log
  52. grep '^:test-result: XPASS$' bar.log
  53. count_test_results total=2 pass=2 fail=0 skip=0 xfail=0 xpass=0 error=0
  54. :