Expand description
The icedwright trace format.
A trace is a .iwtrace zip holding every step a test took:
meta.json format, test, crate, versions, windows, theme, scale, failure, frames dropped
steps.jsonl one Step per line
blobs/<hash>.yaml semantic trees, each stored once
blobs/<hash>.png frames, each stored once
source/<file> the test source files steps point at
real.json real-clock timings, which comparisons skipTraceWriter takes plain values and writes the same bytes for the same steps on every
run: instants are offsets from boot, ids are renumbered in order of first appearance, and
the archive has fixed timestamps, member order and compression settings. When a trace would
pass its size cap, frames are dropped in a fixed order; trees and steps never are.
TraceReader reads it back, and compare finds where two traces first differ.
Structs§
- Attempt
- One evaluation of an
expect. - BadBlob
Hash - Why a string is not a
BlobHash. - Blob
Hash - The blake3 hash of a blob’s bytes, printed as 64 lowercase hex digits.
- BlobRef
- A content-addressed blob whose media type is part of its type, so a tree ref cannot be read as a frame. Only the writer makes them, and reading a trace back.
- Boot
Instant - The real instant the harness booted at, as the platform’s
InstantDebugtext spells it, so instants printed inside message text can be rewritten as offsets from boot. - Byte
Size - A size in bytes.
- Png
- An encoded PNG image, and the media marker for frame blobs.
- RawSubscription
Id - The harness’s id for a subscription.
- RawTask
Id - The harness executor’s id for a task.
- RawWidget
Id - The counter value inside an iced
widget::Id::unique(). - RawWindow
Id - The counter value inside an iced
window::Id. - Real
Span - When a step ran on the real clock, measured from the start of the test.
- Real
Timing - A step’s real timing, kept in
real.json, which comparisons skip. - Real
Timings - Everything in
real.json. - Selector
Text - A selector in its canonical printed form. It is made only from a
CanonicalSelector, so it always parses. - Source
Location - A place in the test’s source.
- Step
- One call the test made on the harness: an action, an
expect, a clock advance, a task release or a window change. Times are measured from boot. - Step
Builder - One open step. Recording into it after
enddoes not compile, becauseendtakes it by value. - Step
Difference - The first step at which two traces differ.
- Step
Index - The position of a step in its trace.
- Subscription
Ordinal - A subscription, numbered in the order the trace first saw it.
- Task
Ordinal - A task, numbered in the order the trace first saw it.
- Trace
Config - How a harness traces. The environment overrides only the mode, output directory and size cap.
- Trace
Event - An input event the harness delivered, with its window renumbered.
- Trace
Message - A message, as its normalised
Debugtext. - Trace
Meta - What a trace is of, filled in by the harness.
- Trace
Reader - A trace read back from its archive. Steps and metadata are read when it opens; blobs, sources and real timings are read on demand.
- Trace
Start - What the app looked like when the harness booted, before any step.
- Trace
Task - A change in a task’s life.
- Trace
Writer - Builds a trace step by step and writes the archive. It takes plain values and knows nothing
about iced; the harness’s step observer drives it. A step is open between
begin_stepandStepBuilder::end. - Widget
Ordinal - A widget with a generated id, numbered in the order the trace first saw it.
- Window
Meta - A window the trace saw.
- Window
Ordinal - A window, numbered in the order the trace first saw it.
- Write
Summary - What
TraceWriter::writewrote.
Enums§
- Captured
- Whether a widget captured an input event, as iced’s
event::Statusreports it. - Difference
- Where two traces first differ.
- Frame
Policy - Which steps keep frames. Frames are rendered the same way under every policy.
- Step
Change - How a step differs between two traces.
- Step
Kind - What the test asked for in a step. Action, assertion, task control and window change kinds are stored by name.
- Step
Outcome - How a step ended.
- Trace
Error - Everything that can go wrong configuring, writing or reading a trace.
- Trace
Mode - When a trace file is written. Recording is the same in every mode, so the mode never changes what the app does.
- Trace
Origin - What produced a message.
- Trace
Task Change - What happened to a task.
- Yaml
- Marks a blob holding a semantic tree as YAML text.
Constants§
- FORMAT
- The format this crate writes and the newest it reads.
Traits§
- Canonical
Selector - Implemented by a locator, whose canonical printed form always parses back to it.
- Media
- A kind of blob a trace stores. Sealed: the format has exactly these.
- RawId
- A raw id from a process-wide counter. The ordinal it renumbers to follows from its type.
Functions§
- compare
- Compares two traces member by member, skipping
real.json, and reports the first step that differs, then the metadata, then any other member by name.Nonemeans they are the same apart from real timings.