tap-negative-numbers.sh 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. # - don't spuriously recognize negative TAP result numbers, but correctly
  18. # interpret them as test descriptions instead
  19. . test-init.sh
  20. . tap-setup.sh
  21. cat > all.test <<'END'
  22. 1..7
  23. ok -1
  24. not ok -3
  25. ok -2 # SKIP
  26. not ok -5 # TODO
  27. ok -04 # TODO
  28. ok -121
  29. not ok -50000
  30. END
  31. run_make -O -e FAIL check
  32. count_test_results total=7 pass=2 fail=2 xpass=1 xfail=1 skip=1 error=0
  33. cat > exp <<'END'
  34. PASS: all.test 1 -1
  35. FAIL: all.test 2 -3
  36. SKIP: all.test 3 -2 # SKIP
  37. XFAIL: all.test 4 -5 # TODO
  38. XPASS: all.test 5 -04 # TODO
  39. PASS: all.test 6 -121
  40. FAIL: all.test 7 -50000
  41. END
  42. $FGREP ': all.test' stdout > got
  43. cat exp
  44. cat got
  45. diff exp got
  46. :