battlestar.test 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. #!/bin/sh
  2. # tests/battlestar.test - test functionality of battlestar.
  3. #
  4. # Copyright (c) 2000 Joseph Samuel Myers.
  5. # All rights reserved.
  6. #
  7. # Redistribution and use in source and binary forms, with or without
  8. # modification, are permitted provided that the following conditions
  9. # are met:
  10. # 1. Redistributions of source code must retain the above copyright
  11. # notice, this list of conditions and the following disclaimer.
  12. # 2. Redistributions in binary form must reproduce the above copyright
  13. # notice, this list of conditions and the following disclaimer in the
  14. # documentation and/or other materials provided with the distribution.
  15. # 3. The name of the author may not be used to endorse or promote products
  16. # derived from this software without specific prior written permission.
  17. #
  18. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  19. # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  20. # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  21. # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  22. # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  23. # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  24. # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  25. # AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  26. # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  27. # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  28. # SUCH DAMAGE.
  29. set -e
  30. . tests/common
  31. testexec battlestar battlestar/battlestar
  32. export BATTLESTAR_QUIET=1
  33. if echo quit | battlestar/battlestar |grep wizard >/dev/null; then
  34. echo "Can't test battlestar as this user."
  35. exit 0
  36. fi
  37. # These tests cover various past bugs found in battlestar.
  38. testno 1
  39. battlestar/battlestar <tests/battlestar.in1 >test.out 2>&1 || failtest
  40. compare test.out tests/battlestar.out1
  41. rm -f test.out
  42. testno 2
  43. battlestar/battlestar <tests/battlestar.in2 >test.out 2>&1 || failtest
  44. compare test.out tests/battlestar.out2
  45. rm -f test.out
  46. testno 3
  47. battlestar/battlestar <tests/battlestar.in3 >test.out 2>&1 || failtest
  48. compare test.out tests/battlestar.out3
  49. rm -f test.out
  50. testno 4
  51. battlestar/battlestar <tests/battlestar.in4 >test.out 2>&1 || failtest
  52. compare test.out tests/battlestar.out4
  53. rm -f test.out
  54. testno 5
  55. battlestar/battlestar <tests/battlestar.in5 >test.out 2>&1 || failtest
  56. compare test.out tests/battlestar.out5
  57. rm -f test.out
  58. testno 6
  59. battlestar/battlestar <tests/battlestar.in6 >test.out 2>/dev/null || failtest
  60. compare test.out tests/battlestar.out6
  61. rm -f test.out
  62. testno 7
  63. battlestar/battlestar <tests/battlestar.in6 >/dev/null 2>test.out || failtest
  64. compare test.out tests/battlestar.err6
  65. rm -f test.out
  66. testno 8
  67. battlestar/battlestar <tests/battlestar.in8 >test.out 2>&1 || failtest
  68. compare test.out tests/battlestar.out8
  69. rm -f test.out
  70. testno 9
  71. battlestar/battlestar <tests/battlestar.in9 >test.out 2>&1 || failtest
  72. compare test.out tests/battlestar.out9
  73. rm -f test.out
  74. testno 10
  75. battlestar/battlestar <tests/battlestar.in10 >test.out 2>&1 || failtest
  76. compare test.out tests/battlestar.out10
  77. rm -f test.out
  78. testno 11
  79. battlestar/battlestar <tests/battlestar.in11 >test.out 2>&1 || failtest
  80. compare test.out tests/battlestar.out11
  81. rm -f test.out
  82. testno 12
  83. battlestar/battlestar <tests/battlestar.in12 >test.out 2>&1 || failtest
  84. compare test.out tests/battlestar.out12
  85. rm -f test.out
  86. testno 13
  87. battlestar/battlestar <tests/battlestar.in13 >test.out 2>&1 || failtest
  88. compare test.out tests/battlestar.out13
  89. rm -f test.out
  90. testno 14
  91. battlestar/battlestar <tests/battlestar.in14 >test.out 2>&1 || failtest
  92. compare test.out tests/battlestar.out14
  93. rm -f test.out
  94. testno 15
  95. battlestar/battlestar </dev/null >test.out 2>&1 || failtest
  96. compare test.out tests/battlestar.out15
  97. rm -f test.out
  98. testno 16
  99. battlestar/battlestar <tests/battlestar.in16 >test.out 2>&1 || failtest
  100. compare test.out tests/battlestar.out16
  101. rm -f test.out
  102. testno 17
  103. battlestar/battlestar <tests/battlestar.in17 >test.out 2>&1 || failtest
  104. compare test.out tests/battlestar.out17
  105. rm -f test.out
  106. testno 18
  107. battlestar/battlestar <tests/battlestar.in18 >test.out 2>&1 || failtest
  108. compare test.out tests/battlestar.out18
  109. rm -f test.out
  110. testno 19
  111. battlestar/battlestar <tests/battlestar.in19 >test.out 2>&1 || failtest
  112. compare test.out tests/battlestar.out19
  113. rm -f test.out
  114. testno 20
  115. battlestar/battlestar <tests/battlestar.in20 >test.out 2>&1 || failtest
  116. compare test.out tests/battlestar.out20
  117. rm -f test.out
  118. testno 21
  119. battlestar/battlestar <tests/battlestar.in21 >test.out 2>&1 || failtest
  120. compare test.out tests/battlestar.out21
  121. rm -f test.out
  122. testno 22
  123. battlestar/battlestar <tests/battlestar.in22 >test.out 2>&1 || failtest
  124. compare test.out tests/battlestar.out22
  125. rm -f test.out
  126. testno 23
  127. battlestar/battlestar <tests/battlestar.in23 >test.out 2>&1 || failtest
  128. compare test.out tests/battlestar.out23
  129. rm -f test.out
  130. testno 24
  131. battlestar/battlestar <tests/battlestar.in24 >test.out 2>&1 || failtest
  132. compare test.out tests/battlestar.out24
  133. rm -f test.out
  134. testno 25
  135. battlestar/battlestar <tests/battlestar.in25 >test.out 2>&1 || failtest
  136. compare test.out tests/battlestar.out25
  137. rm -f test.out
  138. testno 26
  139. battlestar/battlestar <tests/battlestar.in26 >test.out 2>&1 || failtest
  140. compare test.out tests/battlestar.out26
  141. rm -f test.out
  142. testno 27
  143. battlestar/battlestar <tests/battlestar.in27 >test.out 2>&1 || failtest
  144. compare test.out tests/battlestar.out27
  145. rm -f test.out
  146. testno 28
  147. battlestar/battlestar <tests/battlestar.in28 >test.out 2>&1 || failtest
  148. compare test.out tests/battlestar.out28
  149. rm -f test.out
  150. testno 29
  151. battlestar/battlestar <tests/battlestar.in29 >test.out 2>&1 || failtest
  152. compare test.out tests/battlestar.out29
  153. rm -f test.out
  154. testno 30
  155. battlestar/battlestar <tests/battlestar.in30 >test.out 2>&1 || failtest
  156. compare test.out tests/battlestar.out30
  157. rm -f test.out
  158. testno 31
  159. battlestar/battlestar <tests/battlestar.in31 >test.out 2>&1 || failtest
  160. compare test.out tests/battlestar.out31
  161. rm -f test.out
  162. testno 32
  163. battlestar/battlestar <tests/battlestar.in32 >test.out 2>&1 || failtest
  164. compare test.out tests/battlestar.out32
  165. rm -f test.out
  166. testno 33
  167. battlestar/battlestar <tests/battlestar.in33 >test.out 2>&1 || failtest
  168. compare test.out tests/battlestar.out33
  169. rm -f test.out
  170. testno 34
  171. battlestar/battlestar <tests/battlestar.in34 >test.out 2>&1 || failtest
  172. compare test.out tests/battlestar.out34
  173. rm -f test.out
  174. testno 35
  175. battlestar/battlestar <tests/battlestar.in35 >test.out 2>&1 || failtest
  176. compare test.out tests/battlestar.out35
  177. rm -f test.out
  178. testno 36
  179. battlestar/battlestar <tests/battlestar.in36 >test.out 2>&1 || failtest
  180. compare test.out tests/battlestar.out36
  181. rm -f test.out
  182. testno 37
  183. battlestar/battlestar <tests/battlestar.in37 >test.out 2>&1 || failtest
  184. compare test.out tests/battlestar.out37
  185. rm -f test.out
  186. testno 38
  187. battlestar/battlestar <tests/battlestar.in38 >test.out 2>&1 || failtest
  188. compare test.out tests/battlestar.out38
  189. rm -f test.out
  190. testno 39
  191. battlestar/battlestar <tests/battlestar.in39 >test.out 2>&1 || failtest
  192. compare test.out tests/battlestar.out39
  193. rm -f test.out
  194. testno 40
  195. battlestar/battlestar <tests/battlestar.in40 >test.out 2>&1 || failtest
  196. compare test.out tests/battlestar.out40
  197. rm -f test.out
  198. testno 41
  199. battlestar/battlestar <tests/battlestar.in41 >test.out 2>&1 || failtest
  200. compare test.out tests/battlestar.out41
  201. rm -f test.out
  202. testno 42
  203. battlestar/battlestar <tests/battlestar.in42 >test.out 2>&1 || failtest
  204. compare test.out tests/battlestar.out42
  205. rm -f test.out
  206. testno 43
  207. battlestar/battlestar <tests/battlestar.in43 >test.out 2>&1 || failtest
  208. compare test.out tests/battlestar.out43
  209. rm -f test.out