frus-test
Test tooling for frus: widgets rendered offscreen, snapshots queried pixel by pixel, and golden images compared on disk.
Layer: Application, as a consumer of the widgets and the renderer; it belongs in
[dev-dependencies]. See
ARCHITECTURE.md.
What you reach for
render_widgetandrender_scene: one settled frame through the same pipeline as the window. Both returnNonewhen there is no GPU adapter, so a test can skip itself.Snapshot:pixel,diff_count, andassert_golden, which writes the reference PNG the first time and compares against it after that.FRUS_UPDATE_GOLDENS=1rewrites it.Stage: the retained state stepped frame by frame, for a gesture caught in flight.
Pure update logic needs none of this: the application's state is a plain struct.
Example
use render_widget;
use ;
let root: = Boxnew;
if let Some = render_widget
Goldens depend on the rasteriser: generate and compare them in the same environment.
Part of frus
See the workspace README. Licensed under MIT or Apache-2.0.