tap-planskip-and-logging.sh 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. # - interactions between "TAP plan with SKIP" and logging of earlier or
  18. # later TAP or non-TAP text
  19. . test-init.sh
  20. . tap-setup.sh
  21. echo TEST_LOG_DRIVER_FLAGS = --comments >> Makefile
  22. cat > foo.test <<END
  23. 1..0
  24. a non-TAP line
  25. # a comment
  26. END
  27. cat > foo2.test <<END
  28. a non-TAP line 2
  29. # a comment 2
  30. 1..0
  31. END
  32. cat > bar.test <<END
  33. # an early comment
  34. an early non-TAP line
  35. $tab
  36. 1..0 # SKIP
  37. # a later comment
  38. a later non-TAP line
  39. END
  40. run_make -O TESTS='foo.test foo2.test bar.test' check
  41. count_test_results total=3 pass=0 fail=0 xpass=0 xfail=0 skip=3 error=0
  42. grep '^# foo\.test: a comment$' stdout
  43. grep '^# foo2\.test: a comment 2$' stdout
  44. grep '^# bar\.test: an early comment$' stdout
  45. grep '^# bar\.test: a later comment$' stdout
  46. cat foo.log
  47. cat foo2.log
  48. cat bar.log
  49. grep '^a non-TAP line$' foo.log
  50. grep '^# a comment$' foo.log
  51. grep '^a non-TAP line 2$' foo2.log
  52. grep '^# a comment 2$' foo2.log
  53. grep '^# an early comment' bar.log
  54. grep '^an early non-TAP line$' bar.log
  55. grep '^# a later comment' bar.log
  56. grep '^a later non-TAP line$' bar.log
  57. grep "^ $tab$" bar.log
  58. :