tst-fmtmsg.sh 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. #!/bin/sh
  2. # Test of fmtmsg function family.
  3. # Copyright (C) 2000-2019 Free Software Foundation, Inc.
  4. # This file is part of the GNU C Library.
  5. # The GNU C Library is free software; you can redistribute it and/or
  6. # modify it under the terms of the GNU Lesser General Public
  7. # License as published by the Free Software Foundation; either
  8. # version 2.1 of the License, or (at your option) any later version.
  9. # The GNU C Library 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 GNU
  12. # Lesser General Public License for more details.
  13. # You should have received a copy of the GNU Lesser General Public
  14. # License along with the GNU C Library; if not, see
  15. # <http://www.gnu.org/licenses/>.
  16. set -e
  17. common_objpfx=$1
  18. test_program_prefix_before_env=$2
  19. run_program_env=$3
  20. test_program_prefix_after_env=$4
  21. objpfx=$5
  22. test_pre="${test_program_prefix_before_env} ${run_program_env}"
  23. test="${test_program_prefix_after_env} ${objpfx}tst-fmtmsg"
  24. out=${objpfx}tst-fmtmsg.out
  25. ($test_pre MSGVERB= $test || exit 1;
  26. $test_pre MSGVERB=label $test || exit 1;
  27. $test_pre MSGVERB=severity $test || exit 1;
  28. $test_pre MSGVERB=severity:label $test || exit 1;
  29. $test_pre MSGVERB=text $test || exit 1;
  30. $test_pre MSGVERB=text:label $test || exit 1;
  31. $test_pre MSGVERB=text:severity $test || exit 1;
  32. $test_pre MSGVERB=text:severity:label $test || exit 1;
  33. $test_pre MSGVERB=action $test || exit 1;
  34. $test_pre MSGVERB=action:label $test || exit 1;
  35. $test_pre MSGVERB=action:severity $test || exit 1;
  36. $test_pre MSGVERB=action:severity:label $test || exit 1;
  37. $test_pre MSGVERB=action:text $test || exit 1;
  38. $test_pre MSGVERB=action:text:label $test || exit 1;
  39. $test_pre MSGVERB=action:text:severity $test || exit 1;
  40. $test_pre MSGVERB=action:text:severity:label $test || exit 1;
  41. $test_pre MSGVERB=tag $test || exit 1;
  42. $test_pre MSGVERB=tag:label $test || exit 1;
  43. $test_pre MSGVERB=tag:severity $test || exit 1;
  44. $test_pre MSGVERB=tag:severity:label $test || exit 1;
  45. $test_pre MSGVERB=tag:text $test || exit 1;
  46. $test_pre MSGVERB=tag:text:label $test || exit 1;
  47. $test_pre MSGVERB=tag:text:severity $test || exit 1;
  48. $test_pre MSGVERB=tag:text:severity:label $test || exit 1;
  49. $test_pre MSGVERB=tag:action $test || exit 1;
  50. $test_pre MSGVERB=tag:action:label $test || exit 1;
  51. $test_pre MSGVERB=tag:action:severity $test || exit 1;
  52. $test_pre MSGVERB=tag:action:severity:label $test || exit 1;
  53. $test_pre MSGVERB=tag:action:text $test || exit 1;
  54. $test_pre MSGVERB=tag:action:text:label $test || exit 1;
  55. $test_pre MSGVERB=tag:action:text:severity $test || exit 1;
  56. $test_pre MSGVERB=tag:action:text:severity:label $test || exit 1;) 2> $out
  57. cmp $out <<EOF
  58. GLIBC:tst-fmtmsg: HALT: halt
  59. TO FIX: should print message for MM_HALT GLIBC:tst-fmtmsg:1
  60. GLIBC:tst-fmtmsg: ERROR: halt
  61. TO FIX: should print message for MM_ERROR GLIBC:tst-fmtmsg:2
  62. GLIBC:tst-fmtmsg: WARNING: halt
  63. TO FIX: should print message for MM_WARNING GLIBC:tst-fmtmsg:3
  64. GLIBC:tst-fmtmsg: INFO: halt
  65. TO FIX: should print message for MM_INFO GLIBC:tst-fmtmsg:4
  66. GLIBC:tst-fmtmsg: halt
  67. TO FIX: should print message for MM_NOSEV GLIBC:tst-fmtmsg:5
  68. GLIBC:tst-fmtmsg: TEST: halt
  69. TO FIX: should print message for MM_TEST GLIBC:tst-fmtmsg:6
  70. GLIBC:tst-fmtmsg
  71. GLIBC:tst-fmtmsg
  72. GLIBC:tst-fmtmsg
  73. GLIBC:tst-fmtmsg
  74. GLIBC:tst-fmtmsg
  75. GLIBC:tst-fmtmsg
  76. HALT
  77. ERROR
  78. WARNING
  79. INFO
  80. TEST
  81. GLIBC:tst-fmtmsg: HALT
  82. GLIBC:tst-fmtmsg: ERROR
  83. GLIBC:tst-fmtmsg: WARNING
  84. GLIBC:tst-fmtmsg: INFO
  85. GLIBC:tst-fmtmsg
  86. GLIBC:tst-fmtmsg: TEST
  87. halt
  88. halt
  89. halt
  90. halt
  91. halt
  92. halt
  93. GLIBC:tst-fmtmsg: halt
  94. GLIBC:tst-fmtmsg: halt
  95. GLIBC:tst-fmtmsg: halt
  96. GLIBC:tst-fmtmsg: halt
  97. GLIBC:tst-fmtmsg: halt
  98. GLIBC:tst-fmtmsg: halt
  99. HALT: halt
  100. ERROR: halt
  101. WARNING: halt
  102. INFO: halt
  103. halt
  104. TEST: halt
  105. GLIBC:tst-fmtmsg: HALT: halt
  106. GLIBC:tst-fmtmsg: ERROR: halt
  107. GLIBC:tst-fmtmsg: WARNING: halt
  108. GLIBC:tst-fmtmsg: INFO: halt
  109. GLIBC:tst-fmtmsg: halt
  110. GLIBC:tst-fmtmsg: TEST: halt
  111. TO FIX: should print message for MM_HALT
  112. TO FIX: should print message for MM_ERROR
  113. TO FIX: should print message for MM_WARNING
  114. TO FIX: should print message for MM_INFO
  115. TO FIX: should print message for MM_NOSEV
  116. TO FIX: should print message for MM_TEST
  117. GLIBC:tst-fmtmsg: TO FIX: should print message for MM_HALT
  118. GLIBC:tst-fmtmsg: TO FIX: should print message for MM_ERROR
  119. GLIBC:tst-fmtmsg: TO FIX: should print message for MM_WARNING
  120. GLIBC:tst-fmtmsg: TO FIX: should print message for MM_INFO
  121. GLIBC:tst-fmtmsg: TO FIX: should print message for MM_NOSEV
  122. GLIBC:tst-fmtmsg: TO FIX: should print message for MM_TEST
  123. HALT: TO FIX: should print message for MM_HALT
  124. ERROR: TO FIX: should print message for MM_ERROR
  125. WARNING: TO FIX: should print message for MM_WARNING
  126. INFO: TO FIX: should print message for MM_INFO
  127. TO FIX: should print message for MM_NOSEV
  128. TEST: TO FIX: should print message for MM_TEST
  129. GLIBC:tst-fmtmsg: HALT: TO FIX: should print message for MM_HALT
  130. GLIBC:tst-fmtmsg: ERROR: TO FIX: should print message for MM_ERROR
  131. GLIBC:tst-fmtmsg: WARNING: TO FIX: should print message for MM_WARNING
  132. GLIBC:tst-fmtmsg: INFO: TO FIX: should print message for MM_INFO
  133. GLIBC:tst-fmtmsg: TO FIX: should print message for MM_NOSEV
  134. GLIBC:tst-fmtmsg: TEST: TO FIX: should print message for MM_TEST
  135. halt
  136. TO FIX: should print message for MM_HALT
  137. halt
  138. TO FIX: should print message for MM_ERROR
  139. halt
  140. TO FIX: should print message for MM_WARNING
  141. halt
  142. TO FIX: should print message for MM_INFO
  143. halt
  144. TO FIX: should print message for MM_NOSEV
  145. halt
  146. TO FIX: should print message for MM_TEST
  147. GLIBC:tst-fmtmsg: halt
  148. TO FIX: should print message for MM_HALT
  149. GLIBC:tst-fmtmsg: halt
  150. TO FIX: should print message for MM_ERROR
  151. GLIBC:tst-fmtmsg: halt
  152. TO FIX: should print message for MM_WARNING
  153. GLIBC:tst-fmtmsg: halt
  154. TO FIX: should print message for MM_INFO
  155. GLIBC:tst-fmtmsg: halt
  156. TO FIX: should print message for MM_NOSEV
  157. GLIBC:tst-fmtmsg: halt
  158. TO FIX: should print message for MM_TEST
  159. HALT: halt
  160. TO FIX: should print message for MM_HALT
  161. ERROR: halt
  162. TO FIX: should print message for MM_ERROR
  163. WARNING: halt
  164. TO FIX: should print message for MM_WARNING
  165. INFO: halt
  166. TO FIX: should print message for MM_INFO
  167. halt
  168. TO FIX: should print message for MM_NOSEV
  169. TEST: halt
  170. TO FIX: should print message for MM_TEST
  171. GLIBC:tst-fmtmsg: HALT: halt
  172. TO FIX: should print message for MM_HALT
  173. GLIBC:tst-fmtmsg: ERROR: halt
  174. TO FIX: should print message for MM_ERROR
  175. GLIBC:tst-fmtmsg: WARNING: halt
  176. TO FIX: should print message for MM_WARNING
  177. GLIBC:tst-fmtmsg: INFO: halt
  178. TO FIX: should print message for MM_INFO
  179. GLIBC:tst-fmtmsg: halt
  180. TO FIX: should print message for MM_NOSEV
  181. GLIBC:tst-fmtmsg: TEST: halt
  182. TO FIX: should print message for MM_TEST
  183. GLIBC:tst-fmtmsg:1
  184. GLIBC:tst-fmtmsg:2
  185. GLIBC:tst-fmtmsg:3
  186. GLIBC:tst-fmtmsg:4
  187. GLIBC:tst-fmtmsg:5
  188. GLIBC:tst-fmtmsg:6
  189. GLIBC:tst-fmtmsg: GLIBC:tst-fmtmsg:1
  190. GLIBC:tst-fmtmsg: GLIBC:tst-fmtmsg:2
  191. GLIBC:tst-fmtmsg: GLIBC:tst-fmtmsg:3
  192. GLIBC:tst-fmtmsg: GLIBC:tst-fmtmsg:4
  193. GLIBC:tst-fmtmsg: GLIBC:tst-fmtmsg:5
  194. GLIBC:tst-fmtmsg: GLIBC:tst-fmtmsg:6
  195. HALT: GLIBC:tst-fmtmsg:1
  196. ERROR: GLIBC:tst-fmtmsg:2
  197. WARNING: GLIBC:tst-fmtmsg:3
  198. INFO: GLIBC:tst-fmtmsg:4
  199. GLIBC:tst-fmtmsg:5
  200. TEST: GLIBC:tst-fmtmsg:6
  201. GLIBC:tst-fmtmsg: HALT: GLIBC:tst-fmtmsg:1
  202. GLIBC:tst-fmtmsg: ERROR: GLIBC:tst-fmtmsg:2
  203. GLIBC:tst-fmtmsg: WARNING: GLIBC:tst-fmtmsg:3
  204. GLIBC:tst-fmtmsg: INFO: GLIBC:tst-fmtmsg:4
  205. GLIBC:tst-fmtmsg: GLIBC:tst-fmtmsg:5
  206. GLIBC:tst-fmtmsg: TEST: GLIBC:tst-fmtmsg:6
  207. halt
  208. GLIBC:tst-fmtmsg:1
  209. halt
  210. GLIBC:tst-fmtmsg:2
  211. halt
  212. GLIBC:tst-fmtmsg:3
  213. halt
  214. GLIBC:tst-fmtmsg:4
  215. halt
  216. GLIBC:tst-fmtmsg:5
  217. halt
  218. GLIBC:tst-fmtmsg:6
  219. GLIBC:tst-fmtmsg: halt
  220. GLIBC:tst-fmtmsg:1
  221. GLIBC:tst-fmtmsg: halt
  222. GLIBC:tst-fmtmsg:2
  223. GLIBC:tst-fmtmsg: halt
  224. GLIBC:tst-fmtmsg:3
  225. GLIBC:tst-fmtmsg: halt
  226. GLIBC:tst-fmtmsg:4
  227. GLIBC:tst-fmtmsg: halt
  228. GLIBC:tst-fmtmsg:5
  229. GLIBC:tst-fmtmsg: halt
  230. GLIBC:tst-fmtmsg:6
  231. HALT: halt
  232. GLIBC:tst-fmtmsg:1
  233. ERROR: halt
  234. GLIBC:tst-fmtmsg:2
  235. WARNING: halt
  236. GLIBC:tst-fmtmsg:3
  237. INFO: halt
  238. GLIBC:tst-fmtmsg:4
  239. halt
  240. GLIBC:tst-fmtmsg:5
  241. TEST: halt
  242. GLIBC:tst-fmtmsg:6
  243. GLIBC:tst-fmtmsg: HALT: halt
  244. GLIBC:tst-fmtmsg:1
  245. GLIBC:tst-fmtmsg: ERROR: halt
  246. GLIBC:tst-fmtmsg:2
  247. GLIBC:tst-fmtmsg: WARNING: halt
  248. GLIBC:tst-fmtmsg:3
  249. GLIBC:tst-fmtmsg: INFO: halt
  250. GLIBC:tst-fmtmsg:4
  251. GLIBC:tst-fmtmsg: halt
  252. GLIBC:tst-fmtmsg:5
  253. GLIBC:tst-fmtmsg: TEST: halt
  254. GLIBC:tst-fmtmsg:6
  255. TO FIX: should print message for MM_HALT GLIBC:tst-fmtmsg:1
  256. TO FIX: should print message for MM_ERROR GLIBC:tst-fmtmsg:2
  257. TO FIX: should print message for MM_WARNING GLIBC:tst-fmtmsg:3
  258. TO FIX: should print message for MM_INFO GLIBC:tst-fmtmsg:4
  259. TO FIX: should print message for MM_NOSEV GLIBC:tst-fmtmsg:5
  260. TO FIX: should print message for MM_TEST GLIBC:tst-fmtmsg:6
  261. GLIBC:tst-fmtmsg: TO FIX: should print message for MM_HALT GLIBC:tst-fmtmsg:1
  262. GLIBC:tst-fmtmsg: TO FIX: should print message for MM_ERROR GLIBC:tst-fmtmsg:2
  263. GLIBC:tst-fmtmsg: TO FIX: should print message for MM_WARNING GLIBC:tst-fmtmsg:3
  264. GLIBC:tst-fmtmsg: TO FIX: should print message for MM_INFO GLIBC:tst-fmtmsg:4
  265. GLIBC:tst-fmtmsg: TO FIX: should print message for MM_NOSEV GLIBC:tst-fmtmsg:5
  266. GLIBC:tst-fmtmsg: TO FIX: should print message for MM_TEST GLIBC:tst-fmtmsg:6
  267. HALT: TO FIX: should print message for MM_HALT GLIBC:tst-fmtmsg:1
  268. ERROR: TO FIX: should print message for MM_ERROR GLIBC:tst-fmtmsg:2
  269. WARNING: TO FIX: should print message for MM_WARNING GLIBC:tst-fmtmsg:3
  270. INFO: TO FIX: should print message for MM_INFO GLIBC:tst-fmtmsg:4
  271. TO FIX: should print message for MM_NOSEV GLIBC:tst-fmtmsg:5
  272. TEST: TO FIX: should print message for MM_TEST GLIBC:tst-fmtmsg:6
  273. GLIBC:tst-fmtmsg: HALT: TO FIX: should print message for MM_HALT GLIBC:tst-fmtmsg:1
  274. GLIBC:tst-fmtmsg: ERROR: TO FIX: should print message for MM_ERROR GLIBC:tst-fmtmsg:2
  275. GLIBC:tst-fmtmsg: WARNING: TO FIX: should print message for MM_WARNING GLIBC:tst-fmtmsg:3
  276. GLIBC:tst-fmtmsg: INFO: TO FIX: should print message for MM_INFO GLIBC:tst-fmtmsg:4
  277. GLIBC:tst-fmtmsg: TO FIX: should print message for MM_NOSEV GLIBC:tst-fmtmsg:5
  278. GLIBC:tst-fmtmsg: TEST: TO FIX: should print message for MM_TEST GLIBC:tst-fmtmsg:6
  279. halt
  280. TO FIX: should print message for MM_HALT GLIBC:tst-fmtmsg:1
  281. halt
  282. TO FIX: should print message for MM_ERROR GLIBC:tst-fmtmsg:2
  283. halt
  284. TO FIX: should print message for MM_WARNING GLIBC:tst-fmtmsg:3
  285. halt
  286. TO FIX: should print message for MM_INFO GLIBC:tst-fmtmsg:4
  287. halt
  288. TO FIX: should print message for MM_NOSEV GLIBC:tst-fmtmsg:5
  289. halt
  290. TO FIX: should print message for MM_TEST GLIBC:tst-fmtmsg:6
  291. GLIBC:tst-fmtmsg: halt
  292. TO FIX: should print message for MM_HALT GLIBC:tst-fmtmsg:1
  293. GLIBC:tst-fmtmsg: halt
  294. TO FIX: should print message for MM_ERROR GLIBC:tst-fmtmsg:2
  295. GLIBC:tst-fmtmsg: halt
  296. TO FIX: should print message for MM_WARNING GLIBC:tst-fmtmsg:3
  297. GLIBC:tst-fmtmsg: halt
  298. TO FIX: should print message for MM_INFO GLIBC:tst-fmtmsg:4
  299. GLIBC:tst-fmtmsg: halt
  300. TO FIX: should print message for MM_NOSEV GLIBC:tst-fmtmsg:5
  301. GLIBC:tst-fmtmsg: halt
  302. TO FIX: should print message for MM_TEST GLIBC:tst-fmtmsg:6
  303. HALT: halt
  304. TO FIX: should print message for MM_HALT GLIBC:tst-fmtmsg:1
  305. ERROR: halt
  306. TO FIX: should print message for MM_ERROR GLIBC:tst-fmtmsg:2
  307. WARNING: halt
  308. TO FIX: should print message for MM_WARNING GLIBC:tst-fmtmsg:3
  309. INFO: halt
  310. TO FIX: should print message for MM_INFO GLIBC:tst-fmtmsg:4
  311. halt
  312. TO FIX: should print message for MM_NOSEV GLIBC:tst-fmtmsg:5
  313. TEST: halt
  314. TO FIX: should print message for MM_TEST GLIBC:tst-fmtmsg:6
  315. GLIBC:tst-fmtmsg: HALT: halt
  316. TO FIX: should print message for MM_HALT GLIBC:tst-fmtmsg:1
  317. GLIBC:tst-fmtmsg: ERROR: halt
  318. TO FIX: should print message for MM_ERROR GLIBC:tst-fmtmsg:2
  319. GLIBC:tst-fmtmsg: WARNING: halt
  320. TO FIX: should print message for MM_WARNING GLIBC:tst-fmtmsg:3
  321. GLIBC:tst-fmtmsg: INFO: halt
  322. TO FIX: should print message for MM_INFO GLIBC:tst-fmtmsg:4
  323. GLIBC:tst-fmtmsg: halt
  324. TO FIX: should print message for MM_NOSEV GLIBC:tst-fmtmsg:5
  325. GLIBC:tst-fmtmsg: TEST: halt
  326. TO FIX: should print message for MM_TEST GLIBC:tst-fmtmsg:6
  327. EOF
  328. exit $?