macro_rules! snapshots {
($($name:literal),+ $(,)?) => { ... };
}Available on crate feature
snapshot only.Expand description
The snapshots one scene’s frames verify against, in frame order.
A scene that freezes a sequence of frames stores each as its own snapshot
under a directory named for the scene. Listing them here rather than
building the names at run time is what lets a web build carry them in the
binary: the wasm arm embeds every listed file, the way snapshot! embeds
one, and the host arm resolves them under the snapshot directory instead.
The list is the scene’s own frame table, so it is written out in full rather than derived — a frame whose snapshot is missing from the list is a frame the test does not compare, and one named here that has no file fails to compile on the web.
use unlit_wgpu_test_util::snapshots;
// A scene storing two frames under its own directory.
let frames = snapshots![
"animated/frame_00_alloc3_free0_live3.webp",
"animated/frame_01_alloc2_free0_live5.webp",
];
assert_eq!(frames.len(), 2);
assert_eq!(frames[0].name(), "animated/frame_00_alloc3_free0_live3.webp");