Context: profile, registers, frames, locals
Run and project data; core registers, call stack, locals and arguments.
since 0.1.0-rc.1since 0.3.0
Methods
| Entry | Signature | Available since | API 3 |
|---|---|---|---|
profile | profile: Profile | 0.1.0-rc.1¹ | unchanged |
registers | registers(*names, frame=None) -> dict | 0.3.0 | unchanged |
frames | frames(limit=16) -> dict | 0.3.0 | unchanged |
locals, arguments | locals(frame=None) -> dict; arguments(frame=None) -> dict | 0.3.0 | unchanged |
¹ Base form; the 0.3.0 extensions are described in the card.
API 3 changes (0.5.0)
Unchanged, no await.
Recommended
Project parameters through profile.get with a default; arguments in the stopped frame.
count = t.profile.get("user.measurement.count", 10)
core = t.registers("pc", "sp")
t.record("core", core)
t.check("top frame", t.frames(limit=8)["frames"][0]["function"], "app_step")
t.reach("app_step")
t.check("mode argument", t.arguments()["values"]["mode"], t.evaluate("APP_MODE_BLINK"))Avoid
Hard-coded numbers instead of profile parameters; an index chain fails when a section is missing.
count = t.profile["user"]["measurement"]["count"] # fails without the section
t.check("delay", t.read("app_delay"), 100) # expectation not taken from the profileThe fragments show refused or discouraged patterns, not a working recipe.
Fragments for a scenario body; firmware symbols are illustrative.