Debian Codegraph @

test/test_user_script.py

raw symbols SCIP
1 # Test user script.
2
3 @command(help="test command")
4 def testcmd(f: float, i: int, s: str):
5 assert isinstance(f, float)
6 assert isinstance(i, int)
7 assert isinstance(s, str)
8
9 @command("anothertestcmd", help="second test command")
10 def testcmd2(*args):
11 assert isinstance(args, tuple)
12 assert all(isinstance(s, str) for s in args)
13
14
15 # Provides stub implementations of all hooks.
16
17 def will_connect(board):
18 """@brief Pre-init hook for the board.
19 @param self
20 @param board A Board instance that is about to be initialized.
21 @return Ignored.
22 """
23 pass
24
25 def did_connect(board):
26 """@brief Post-initialization hook for the board.
27 @param self
28 @param board A Board instance.
29 @return Ignored.
30 """
31 pass
32
33 def will_init_target(target, init_sequence):
34 """@brief Hook to review and modify init call sequence prior to execution.
35 @param self
36 @param target A CoreSightTarget object about to be initialized.
37 @param init_sequence The CallSequence that will be invoked. Because call sequences are
38 mutable, this parameter can be modified before return to change the init calls.
39 @return Ignored.
40 """
41 pass
42
43 def did_init_target(target):
44 """@brief Post-initialization hook.
45 @param self
46 @param target A CoreSightTarget.
47 @return Ignored.
48 """
49 pass
50
51 def will_start_debug_core(core):
52 """@brief Hook to enable debug for the given core.
53 @param self
54 @param core A CortexM object about to be initialized.
55 @retval True Do not perform the normal procedure to start core debug.
56 @retval "False or None" Continue with normal behaviour.
57 """
58 pass
59
60 def did_start_debug_core(core):
61 """@brief Post-initialization hook.
62 @param self
63 @param core A CortexM object.
64 @return Ignored.
65 """
66 pass
67
68 def will_stop_debug_core(core):
69 """@brief Pre-cleanup hook for the core.
70 @param self
71 @param core A CortexM object.
72 @retval True Do not perform the normal procedure to disable core debug.
73 @retval "False or None" Continue with normal behaviour.
74 """
75 pass
76
77 def did_stop_debug_core(core):
78 """@brief Post-cleanup hook for the core.
79 @param self
80 @param core A CortexM object.
81 @return Ignored.
82 """
83 pass
84
85 def will_disconnect(target, resume):
86 """@brief Pre-disconnect hook.
87 @param self
88 @param target Either a CoreSightTarget or CortexM object.
89 @param resume The value of the `disconnect_on_resume` option.
90 @return Ignored.
91 """
92 pass
93
94 def did_disconnect(target, resume):
95 """@brief Post-disconnect hook.
96 @param self
97 @param target Either a CoreSightTarget or CortexM object.
98 @param resume The value of the `disconnect_on_resume` option.
99 @return Ignored."""
100 pass
101
102 def will_reset(core, reset_type):
103 """@brief Pre-reset hook.
104 @param self
105 @param core A CortexM instance.
106 @param reset_type One of the Target.ResetType enumerations.
107 @retval True
108 @retval "False or None"
109 """
110 pass
111
112 def did_reset(core, reset_type):
113 """@brief Post-reset hook.
114 @param self
115 @param core A CortexM instance.
116 @param reset_type One of the Target.ResetType enumerations.
117 @return Ignored.
118 """
119 pass
120
121 def set_reset_catch(core, reset_type):
122 """@brief Hook to prepare target for halting on reset.
123 @param self
124 @param core A CortexM instance.
125 @param reset_type One of the Target.ResetType enumerations.
126 @retval True
127 @retval "False or None"
128 """
129 pass
130
131 def clear_reset_catch(core, reset_type):
132 """@brief Hook to clean up target after a reset and halt.
133 @param self
134 @param core A CortexM instance.
135 @param reset_type
136 @return Ignored.
137 """
138 pass
139
140 def mass_erase(target):
141 """@brief Hook to override mass erase.
142 @param self
143 @param target A CoreSightTarget object.
144 @retval True Indicate that mass erase was performed by the hook.
145 @retval "False or None" Mass erase was not overridden and the caller should proceed with the standard
146 mass erase procedure.
147 """
148 pass
149
150 def trace_start(target, mode):
151 """@brief Hook to prepare for tracing the target.
152 @param self
153 @param target A CoreSightTarget object.
154 @param mode The trace mode. Currently always 0 to indicate SWO.
155 @return Ignored.
156 """
157 pass
158
159 def trace_stop(target, mode):
160 """@brief Hook to clean up after tracing the target.
161 @param self
162 @param target A CoreSightTarget object.
163 @param mode The trace mode. Currently always 0 to indicate SWO.
164 @return Ignored.
165 """
166 pass
167
168 def trace_capture(target, mode):
169 """@brief Hook to capture trace data.
170 @param self
171 @param target A CoreSightTarget object.
172 @param mode The trace mode. Currently always 0 to indicate SWO.
173 @return Ignored.
174 """
175 pass
176
177 def trace_flush(target, mode):
178 """@brief Hook to flush trace data.
179 @param self
180 @param target A CoreSightTarget object.
181 @param mode The trace mode. Currently always 0 to indicate SWO.
182 @return Ignored.
183 """
184 pass
185