tap-plan-middle.sh 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. # - test plan preceding and/or following non-result TAP lines
  18. . test-init.sh
  19. . tap-setup.sh
  20. cat > top1.test <<END
  21. non-TAP line, ignored
  22. 1..1
  23. ok 1
  24. END
  25. cat > top2.test <<END
  26. some
  27. non-TAP
  28. lines
  29. are
  30. ignored
  31. # and a TAP comment won't cause problems either
  32. 1..2
  33. ok 1
  34. ok 2
  35. END
  36. # Try with a blank line too, just to be sure.
  37. cat > top3.test <<END
  38. 1..1
  39. ok 1
  40. END
  41. cat > bot1.test <<END
  42. ok 1 # SKIP
  43. 1..1
  44. bla blah blah ...
  45. END
  46. cat > bot2.test <<END
  47. ok 1
  48. ok 2
  49. not ok 3 # TODO
  50. 1..3
  51. #@$%! (a cursing comment :-)
  52. END
  53. # Try with a blank line too, just to be sure.
  54. cat > bot3.test <<END
  55. ok 1
  56. not ok 2 # TODO
  57. ok 3 # SKIP
  58. ok 4 # SKIP
  59. 1..4
  60. END
  61. tests=$(echo *.test)
  62. for tap_flags in "" "--comments"; do
  63. run_make -O TEST_LOG_DRIVER_FLAGS="$tap_flags" TESTS="$tests" check
  64. count_test_results total=12 pass=7 xfail=2 skip=3 fail=0 xpass=0 error=0
  65. done
  66. :