testsuite-summary-count.sh 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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. # Check test counts in the testsuite summary.
  17. . test-lib.sh
  18. use_colors=no; use_vpath=no
  19. . testsuite-summary-checks.sh
  20. ./configure
  21. header="\
  22. ${br}
  23. Testsuite summary for GNU AutoFoo 7.1
  24. ${br}"
  25. success_footer=${br}
  26. failure_footer="\
  27. ${br}
  28. See ./test-suite.log
  29. Please report to bug-automake@gnu.org
  30. ${br}"
  31. # Corner cases.
  32. do_check '' <<END
  33. $header
  34. # TOTAL: 0
  35. # PASS: 0
  36. # SKIP: 0
  37. # XFAIL: 0
  38. # FAIL: 0
  39. # XPASS: 0
  40. # ERROR: 0
  41. $success_footer
  42. END
  43. do_check pass.t <<END
  44. $header
  45. # TOTAL: 1
  46. # PASS: 1
  47. # SKIP: 0
  48. # XFAIL: 0
  49. # FAIL: 0
  50. # XPASS: 0
  51. # ERROR: 0
  52. $success_footer
  53. END
  54. do_check fail.t <<END
  55. $header
  56. # TOTAL: 1
  57. # PASS: 0
  58. # SKIP: 0
  59. # XFAIL: 0
  60. # FAIL: 1
  61. # XPASS: 0
  62. # ERROR: 0
  63. $failure_footer
  64. END
  65. # Some simpler checks, with low or moderate number of tests.
  66. do_check skip.t skip2.t skip3.t xfail.t xfail2.t <<END
  67. $header
  68. # TOTAL: 5
  69. # PASS: 0
  70. # SKIP: 3
  71. # XFAIL: 2
  72. # FAIL: 0
  73. # XPASS: 0
  74. # ERROR: 0
  75. $success_footer
  76. END
  77. do_check pass.t pass2.t xfail.t xpass.t error.t error2.t <<END
  78. $header
  79. # TOTAL: 6
  80. # PASS: 2
  81. # SKIP: 0
  82. # XFAIL: 1
  83. # FAIL: 0
  84. # XPASS: 1
  85. # ERROR: 2
  86. $failure_footer
  87. END
  88. pass_count=22
  89. skip_count=19
  90. xfail_count=21
  91. fail_count=18
  92. xpass_count=23
  93. error_count=17
  94. tests_count=120
  95. pass=$(seq_ 1 $pass_count | sed 's/.*/pass-&.t/')
  96. skip=$(seq_ 1 $skip_count | sed 's/.*/skip-&.t/')
  97. xfail=$(seq_ 1 $xfail_count | sed 's/.*/xfail-&.t/')
  98. fail=$(seq_ 1 $fail_count | sed 's/.*/fail-&.t/')
  99. xpass=$(seq_ 1 $xpass_count | sed 's/.*/xpass-&.t/')
  100. error=$(seq_ 1 $error_count | sed 's/.*/error-&.t/')
  101. do_check $pass $skip $xfail $fail $xpass $error <<END
  102. $header
  103. # TOTAL: $tests_count
  104. # PASS: $pass_count
  105. # SKIP: $skip_count
  106. # XFAIL: $xfail_count
  107. # FAIL: $fail_count
  108. # XPASS: $xpass_count
  109. # ERROR: $error_count
  110. $failure_footer
  111. END
  112. # Mild stress test with a lot of test scripts.
  113. tests_count=1888
  114. pass_count=1403
  115. skip_count=292
  116. xfail_count=41
  117. fail_count=126
  118. xpass_count=17
  119. error_count=9
  120. pass=$(seq_ 1 $pass_count | sed 's/.*/pass-&.t/')
  121. skip=$(seq_ 1 $skip_count | sed 's/.*/skip-&.t/')
  122. xfail=$(seq_ 1 $xfail_count | sed 's/.*/xfail-&.t/')
  123. fail=$(seq_ 1 $fail_count | sed 's/.*/fail-&.t/')
  124. xpass=$(seq_ 1 $xpass_count | sed 's/.*/xpass-&.t/')
  125. error=$(seq_ 1 $error_count | sed 's/.*/error-&.t/')
  126. do_check $pass $skip $xfail $fail $xpass $error <<END
  127. $header
  128. # TOTAL: $tests_count
  129. # PASS: $pass_count
  130. # SKIP: $skip_count
  131. # XFAIL: $xfail_count
  132. # FAIL: $fail_count
  133. # XPASS: $xpass_count
  134. # ERROR: $error_count
  135. $failure_footer
  136. END
  137. :