tap-global-log.sh 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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. # - which log files get copied in the global log?
  18. . test-init.sh
  19. . tap-setup.sh
  20. cat > ok.test << 'END'
  21. 1..5
  22. ok 1
  23. ok 2
  24. ok 3
  25. not seen in global log
  26. ok 4
  27. ok 5
  28. END
  29. cat > top << 'END'
  30. 1..6
  31. ok 1
  32. ok 2
  33. ok 3
  34. END
  35. cat > bot << 'END'
  36. ok 5
  37. ok 6
  38. END
  39. cat top - bot > skip.test << 'END'
  40. ok # SKIP
  41. ::skip::
  42. END
  43. cat top - bot > todo.test << 'END'
  44. not ok # TODO
  45. ::todo::
  46. END
  47. cat top - bot > fail.test << 'END'
  48. not ok
  49. ::fail::
  50. END
  51. cat top - bot > xpass.test << 'END'
  52. ok # TODO
  53. ::xpass::
  54. END
  55. cat top - bot > bail.test << 'END'
  56. ::bail::
  57. Bail out!
  58. END
  59. cat top - bot > error.test << 'END'
  60. ::error::
  61. 1..7
  62. END
  63. # Created with "dd if=/dev/urandom count=1 | base64-encode"
  64. cat > hodgepodge <<'END'
  65. 1+0 records in
  66. 1+0 records out
  67. 512 bytes (512 B) copied, 0.000241092 s, 2.1 MB/s
  68. gdivnV4VhL4DOzhE3zULJuun3PwqqQqMdATVcZbIQkNgyRvNBoqqHMBQEs7QsjDbp2nK+Szz
  69. EcelGyvXmHrW7yImaom6Yrg95k31VCmp/pGDRnTDwDrcOPJiv9jDReEmTAQkPuqLO+mFNly+
  70. DDHM9fNbzGumstsQ3wq3DOXz1pCV3JXwhjeaHSboeEbmr55bX0XHLSKaecctA0rXDXEyZWZ/
  71. ODlawSrAXzw0H7a+xBwjnNXZ3zYiwk3x+WQrPqNjb+qXiLLTxAKzx2/KnaFhxkPlte5jPRNB
  72. FciDolL+H/10LsCdSzLOrGnY2zH6vL2JMZfxjnb73zWFcdWWE01LTD7wpN5O1MP3+N47lcVe
  73. lWbkD04cJvhwxLElYSO24B743GG5EyGYt9SeZRE6xbgwq3fVOS8KqjwGxwi4adSBTtw0CV8W
  74. S/6n8dck1vBvjA+qpk0zMSYSqc3+jzW9UiGTmTEIwfw80p/lGNsfjcNBJ86nFkWUnHmrsi8k
  75. Dv57sK70mTg239g08f5Uvdga/5UreMBSgB0hUj5sbq57r7B1fsVr0Kag468la8zKy3ZEZ0gX
  76. ++sbaJ9WGHhnKvjooeH+4Y6HwAFsdINde++FlCmp4EuNKKEEuXbSKLaOTy3+6pJ2DYdvRCL+
  77. frZwxH4hcrw8qh+8IakB02viewZS/qT57v4=
  78. END
  79. exec 5>misc.test
  80. echo 'ok # SKIP' >&5
  81. cat hodgepodge >&5
  82. echo 'not ok # TODO' >&5
  83. echo 'ok' >&5
  84. exec 5>&-
  85. cat > skipall.test << 'END'
  86. 1..0 # SKIP all
  87. END
  88. run_make -e IGNORE TESTS="$(echo *.test)" check
  89. cat test-suite.log
  90. grep ':.*ok|not seen' test-suite.log && exit 1
  91. for s in skip todo fail xpass bail error; do
  92. $FGREP "::$s::" test-suite.log
  93. done
  94. grep '^1\.\.0 # SKIP all$' test-suite.log
  95. test_suite_contents=$(cat test-suite.log)
  96. hodgepodge_contents=$(cat hodgepodge)
  97. case $test_suite_contents in
  98. *"$hodgepodge_contents"*) ;;
  99. *) exit 1;;
  100. esac
  101. :