Navigation: reach, step, until, finish
Run to a function or line, step, run until return. Each operation returns the stop.
since 0.1.0-rc.1since 0.3.0
Methods
| Entry | Signature | Available since | API 3 |
|---|---|---|---|
reach | reach(location, condition=None) -> dict | 0.1.0-rc.1¹ | await in async |
step | step(count=1, *, unit="source", mode="into") -> dict | 0.3.0 | await in async |
until | until(location=None) -> dict | 0.3.0 | await in async |
finish | finish() -> dict | 0.3.0 | await in async |
¹ Base form; the 0.3.0 extensions are described in the card.
API 3 changes (0.5.0)
Use await in async def. A reach condition is evaluated without calling target functions.
Recommended
The condition is an expression over data; finish returns to the calling frame.
t.reach("board_adc_sample", condition="board_adc_sequences == 3")
t.reach("app_step")
t.finish()
t.check("returned to the caller", t.frames()["frames"][0]["function"], "app_receiver_step")
t.until("app_loop")
t.step(3)
# async def
await t.reach("app_step")
await t.finish()Avoid
A function call in a condition is refused (expression_call_forbidden). A step loop instead of reach with a condition wastes time and points.
t.reach("board_adc_sample", condition="board_adc_ready()") # hidden call: refused
while t.read("board_adc_sequences") < 3:
t.step() # use reach with a conditionThe fragments show refused or discouraged patterns, not a working recipe.
Fragments for a scenario body; firmware symbols are illustrative.