app_test.py 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  1. #!/usr/bin/env python
  2. import sys
  3. import panic_tests as test
  4. from test_panic_util.test_panic_util import panic_test, run_all
  5. # test_task_wdt
  6. @panic_test(target=['ESP32', 'ESP32S2'])
  7. def test_panic_task_wdt(env, _extra_data):
  8. test.task_wdt_inner(env, 'panic')
  9. @panic_test()
  10. def test_coredump_task_wdt_uart_elf_crc(env, _extra_data):
  11. test.task_wdt_inner(env, 'coredump_uart_elf_crc')
  12. @panic_test()
  13. def test_coredump_task_wdt_uart_bin_crc(env, _extra_data):
  14. test.task_wdt_inner(env, 'coredump_uart_bin_crc')
  15. @panic_test()
  16. def test_coredump_task_wdt_flash_elf_sha(env, _extra_data):
  17. test.task_wdt_inner(env, 'coredump_flash_elf_sha')
  18. @panic_test()
  19. def test_coredump_task_wdt_flash_bin_crc(env, _extra_data):
  20. test.task_wdt_inner(env, 'coredump_flash_bin_crc')
  21. @panic_test()
  22. def test_gdbstub_task_wdt(env, _extra_data):
  23. test.task_wdt_inner(env, 'gdbstub')
  24. # test_int_wdt
  25. @panic_test()
  26. def test_panic_int_wdt(env, _extra_data):
  27. test.int_wdt_inner(env, 'panic')
  28. @panic_test()
  29. def test_coredump_int_wdt_uart_elf_crc(env, _extra_data):
  30. test.int_wdt_inner(env, 'coredump_uart_elf_crc')
  31. @panic_test()
  32. def test_coredump_int_wdt_uart_bin_crc(env, _extra_data):
  33. test.int_wdt_inner(env, 'coredump_uart_bin_crc')
  34. @panic_test()
  35. def test_coredump_int_wdt_flash_elf_sha(env, _extra_data):
  36. test.int_wdt_inner(env, 'coredump_flash_elf_sha')
  37. @panic_test()
  38. def test_coredump_int_wdt_flash_bin_crc(env, _extra_data):
  39. test.int_wdt_inner(env, 'coredump_flash_bin_crc')
  40. @panic_test()
  41. def test_gdbstub_int_wdt(env, _extra_data):
  42. test.int_wdt_inner(env, 'gdbstub')
  43. # test_int_wdt_cache_disabled
  44. @panic_test()
  45. def test_panic_int_wdt_cache_disabled(env, _extra_data):
  46. test.int_wdt_cache_disabled_inner(env, 'panic')
  47. @panic_test()
  48. def test_coredump_int_wdt_cache_disabled_uart_elf_crc(env, _extra_data):
  49. test.int_wdt_cache_disabled_inner(env, 'coredump_uart_elf_crc')
  50. @panic_test()
  51. def test_coredump_int_wdt_cache_disabled_uart_bin_crc(env, _extra_data):
  52. test.int_wdt_cache_disabled_inner(env, 'coredump_uart_bin_crc')
  53. @panic_test()
  54. def test_coredump_int_wdt_cache_disabled_flash_elf_sha(env, _extra_data):
  55. test.int_wdt_cache_disabled_inner(env, 'coredump_flash_elf_sha')
  56. @panic_test()
  57. def test_coredump_int_wdt_cache_disabled_flash_bin_crc(env, _extra_data):
  58. test.int_wdt_cache_disabled_inner(env, 'coredump_flash_bin_crc')
  59. @panic_test()
  60. def test_gdbstub_int_wdt_cache_disabled(env, _extra_data):
  61. test.int_wdt_cache_disabled_inner(env, 'gdbstub')
  62. # test_cache_error
  63. @panic_test()
  64. def test_panic_cache_error(env, _extra_data):
  65. test.cache_error_inner(env, 'panic')
  66. @panic_test()
  67. def test_coredump_cache_error_uart_elf_crc(env, _extra_data):
  68. test.cache_error_inner(env, 'coredump_uart_elf_crc')
  69. @panic_test()
  70. def test_coredump_cache_error_uart_bin_crc(env, _extra_data):
  71. test.cache_error_inner(env, 'coredump_uart_bin_crc')
  72. @panic_test()
  73. def test_coredump_cache_error_flash_elf_sha(env, _extra_data):
  74. test.cache_error_inner(env, 'coredump_flash_elf_sha')
  75. @panic_test()
  76. def test_coredump_cache_error_flash_bin_crc(env, _extra_data):
  77. test.cache_error_inner(env, 'coredump_flash_bin_crc')
  78. @panic_test()
  79. def test_gdbstub_cache_error(env, _extra_data):
  80. test.cache_error_inner(env, 'gdbstub')
  81. # test_stack_overflow
  82. @panic_test(target=['ESP32', 'ESP32S2'])
  83. def test_panic_stack_overflow(env, _extra_data):
  84. test.stack_overflow_inner(env, 'panic')
  85. @panic_test()
  86. def test_coredump_stack_overflow_uart_elf_crc(env, _extra_data):
  87. test.stack_overflow_inner(env, 'coredump_uart_elf_crc')
  88. @panic_test()
  89. def test_coredump_stack_overflow_uart_bin_crc(env, _extra_data):
  90. test.stack_overflow_inner(env, 'coredump_uart_bin_crc')
  91. @panic_test()
  92. def test_coredump_stack_overflow_flash_elf_sha(env, _extra_data):
  93. test.stack_overflow_inner(env, 'coredump_flash_elf_sha')
  94. @panic_test()
  95. def test_coredump_stack_overflow_flash_bin_crc(env, _extra_data):
  96. test.stack_overflow_inner(env, 'coredump_flash_bin_crc')
  97. @panic_test()
  98. def test_gdbstub_stack_overflow(env, _extra_data):
  99. test.stack_overflow_inner(env, 'gdbstub')
  100. # test_instr_fetch_prohibited
  101. @panic_test(target=['ESP32', 'ESP32S2'])
  102. def test_panic_instr_fetch_prohibited(env, _extra_data):
  103. test.instr_fetch_prohibited_inner(env, 'panic')
  104. @panic_test()
  105. def test_coredump_instr_fetch_prohibited_uart_elf_crc(env, _extra_data):
  106. test.instr_fetch_prohibited_inner(env, 'coredump_uart_elf_crc')
  107. @panic_test()
  108. def test_coredump_instr_fetch_prohibited_uart_bin_crc(env, _extra_data):
  109. test.instr_fetch_prohibited_inner(env, 'coredump_uart_bin_crc')
  110. @panic_test()
  111. def test_coredump_instr_fetch_prohibited_flash_elf_sha(env, _extra_data):
  112. test.instr_fetch_prohibited_inner(env, 'coredump_flash_elf_sha')
  113. @panic_test()
  114. def test_coredump_instr_fetch_prohibited_flash_bin_crc(env, _extra_data):
  115. test.instr_fetch_prohibited_inner(env, 'coredump_flash_bin_crc')
  116. @panic_test()
  117. def test_gdbstub_instr_fetch_prohibited(env, _extra_data):
  118. test.instr_fetch_prohibited_inner(env, 'gdbstub')
  119. # test_illegal_instruction
  120. @panic_test(target=['ESP32', 'ESP32S2'])
  121. def test_panic_illegal_instruction(env, _extra_data):
  122. test.illegal_instruction_inner(env, 'panic')
  123. @panic_test()
  124. def test_coredump_illegal_instruction_uart_elf_crc(env, _extra_data):
  125. test.illegal_instruction_inner(env, 'coredump_uart_elf_crc')
  126. @panic_test()
  127. def test_coredump_illegal_instruction_uart_bin_crc(env, _extra_data):
  128. test.illegal_instruction_inner(env, 'coredump_uart_bin_crc')
  129. @panic_test()
  130. def test_coredump_illegal_instruction_flash_elf_sha(env, _extra_data):
  131. test.illegal_instruction_inner(env, 'coredump_flash_elf_sha')
  132. @panic_test()
  133. def test_coredump_illegal_instruction_flash_bin_crc(env, _extra_data):
  134. test.illegal_instruction_inner(env, 'coredump_flash_bin_crc')
  135. @panic_test()
  136. def test_gdbstub_illegal_instruction(env, _extra_data):
  137. test.illegal_instruction_inner(env, 'gdbstub')
  138. # test_storeprohibited
  139. @panic_test(target=['ESP32', 'ESP32S2'])
  140. def test_panic_storeprohibited(env, _extra_data):
  141. test.storeprohibited_inner(env, 'panic')
  142. @panic_test()
  143. def test_coredump_storeprohibited_uart_elf_crc(env, _extra_data):
  144. test.storeprohibited_inner(env, 'coredump_uart_elf_crc')
  145. @panic_test()
  146. def test_coredump_storeprohibited_uart_bin_crc(env, _extra_data):
  147. test.storeprohibited_inner(env, 'coredump_uart_bin_crc')
  148. @panic_test()
  149. def test_coredump_storeprohibited_flash_elf_sha(env, _extra_data):
  150. test.storeprohibited_inner(env, 'coredump_flash_elf_sha')
  151. @panic_test()
  152. def test_coredump_storeprohibited_flash_bin_crc(env, _extra_data):
  153. test.storeprohibited_inner(env, 'coredump_flash_bin_crc')
  154. @panic_test()
  155. def test_gdbstub_storeprohibited(env, _extra_data):
  156. test.storeprohibited_inner(env, 'gdbstub')
  157. # test_abort
  158. @panic_test(target=['ESP32', 'ESP32S2'])
  159. def test_panic_abort(env, _extra_data):
  160. test.abort_inner(env, 'panic')
  161. @panic_test(target=['ESP32'])
  162. def test_panic_abort_cache_disabled(env, _extra_data):
  163. test.abort_cached_disabled_inner(env, 'panic')
  164. @panic_test()
  165. def test_coredump_abort_uart_elf_crc(env, _extra_data):
  166. test.abort_inner(env, 'coredump_uart_elf_crc')
  167. @panic_test()
  168. def test_coredump_abort_uart_bin_crc(env, _extra_data):
  169. test.abort_inner(env, 'coredump_uart_bin_crc')
  170. @panic_test()
  171. def test_coredump_abort_flash_elf_sha(env, _extra_data):
  172. test.abort_inner(env, 'coredump_flash_elf_sha')
  173. @panic_test()
  174. def test_coredump_abort_flash_bin_crc(env, _extra_data):
  175. test.abort_inner(env, 'coredump_flash_bin_crc')
  176. @panic_test()
  177. def test_gdbstub_abort(env, _extra_data):
  178. test.abort_inner(env, 'gdbstub')
  179. # test_assert
  180. @panic_test(target=['ESP32', 'ESP32S2'])
  181. def test_panic_assert(env, _extra_data):
  182. test.assert_inner(env, 'panic')
  183. @panic_test(target=['ESP32'])
  184. def test_panic_assert_cache_disabled(env, _extra_data):
  185. test.assert_cached_disabled_inner(env, 'panic')
  186. # test_ub
  187. @panic_test()
  188. def test_panic_ub(env, _extra_data):
  189. test.ub_inner(env, 'panic')
  190. @panic_test()
  191. def test_coredump_ub_uart_elf_crc(env, _extra_data):
  192. test.ub_inner(env, 'coredump_uart_elf_crc')
  193. @panic_test()
  194. def test_coredump_ub_uart_bin_crc(env, _extra_data):
  195. test.ub_inner(env, 'coredump_uart_bin_crc')
  196. @panic_test()
  197. def test_coredump_ub_flash_elf_sha(env, _extra_data):
  198. test.ub_inner(env, 'coredump_flash_elf_sha')
  199. @panic_test()
  200. def test_coredump_ub_flash_bin_crc(env, _extra_data):
  201. test.ub_inner(env, 'coredump_flash_bin_crc')
  202. @panic_test()
  203. def test_gdbstub_ub(env, _extra_data):
  204. test.ub_inner(env, 'gdbstub')
  205. if __name__ == '__main__':
  206. run_all(__file__, sys.argv[1:])