egui/crates/egui_kittest/src
lucasmerlin 52060c0c41
Change `Harness::run` to run until no more repaints are requested (#5580)
Previously, `Harness::run` just called `Harness::step` 3 times. If that
wasn't enough, tests would often call run multiple times so all
animations would finish properly.

Also, I introduced `HarnessBuilder::with_step_dt` to customize with how
big of a dt each frame is called. I set the default to 1.0 / 6.0 (~6fps)
so we don't waste cpu in tests waiting on animations.

`HarnessBuilder::max_steps` allows us to control how many steps
`Harness::run` should run before panicing.
The default is 6, so we run for up to 1.0 logical seconds (six frames at
6 fps), which should be enough to finish most animations.

Turns out a lot of snapshots where rendered before fully shown and had a
light opacity, those are now fixed.

* [x] I have followed the instructions in the PR template
2025-01-07 08:33:44 +01:00
..
app_kind.rs ⚠️ `Frame` now includes stroke width as part of padding (#5575) 2025-01-04 10:29:22 +01:00
builder.rs Change `Harness::run` to run until no more repaints are requested (#5580) 2025-01-07 08:33:44 +01:00
event.rs Add egui testing library (#5166) 2024-10-22 12:39:00 +02:00
lib.rs Change `Harness::run` to run until no more repaints are requested (#5580) 2025-01-07 08:33:44 +01:00
renderer.rs Add `Harness::new_eframe` and `TestRenderer` trait (#5539) 2025-01-02 17:48:39 +01:00
snapshot.rs egui_kittest: write `.old.png` files when updating images (#5578) 2025-01-03 16:23:31 +01:00
texture_to_image.rs Add egui testing library (#5166) 2024-10-22 12:39:00 +02:00
wgpu.rs Add `Harness::new_eframe` and `TestRenderer` trait (#5539) 2025-01-02 17:48:39 +01:00