tap-autonumber.sh 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #! /bin/sh
  2. # Copyright (C) 2011-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. # TAP support:
  17. # - unnumbered tests are OK, as long as their final total number
  18. # agrees with the plan
  19. # - test results without number get automatically numbered in the
  20. # console progress output
  21. . test-init.sh
  22. . tap-setup.sh
  23. cat > all.test <<'END'
  24. 1..14
  25. ok
  26. ok foo
  27. ok - foo2
  28. not ok
  29. not ok bar
  30. not ok - bar2
  31. ; See that we can intermingle different kind of results without
  32. ; messing up the autonumbering
  33. ok
  34. ok # TODO
  35. not ok # TODO who cares?
  36. ok
  37. not ok
  38. ok muuu # SKIP
  39. not ok
  40. ok
  41. END
  42. run_make -O -e FAIL TESTS=all.test check
  43. count_test_results total=14 pass=6 fail=5 xpass=1 xfail=1 skip=1 error=0
  44. cat > exp <<'END'
  45. PASS: all.test 1
  46. PASS: all.test 2 foo
  47. PASS: all.test 3 - foo2
  48. FAIL: all.test 4
  49. FAIL: all.test 5 bar
  50. FAIL: all.test 6 - bar2
  51. PASS: all.test 7
  52. XPASS: all.test 8 # TODO
  53. XFAIL: all.test 9 # TODO who cares?
  54. PASS: all.test 10
  55. FAIL: all.test 11
  56. SKIP: all.test 12 muuu # SKIP
  57. FAIL: all.test 13
  58. PASS: all.test 14
  59. END
  60. $FGREP ': all.test' stdout > got
  61. cat exp
  62. cat got
  63. diff exp got
  64. :