1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-02 23:00:04 -04:00

egui_kittest: Allow customizing the snapshot threshold and path (#5304)

This adds `egui_kittest::try_image_snapshot_options` and
`egui_kittest::image_snapshot_options`, as well as
`Harness::wgpu_snapshot_options` and
`Harness::try_wgpu_snapshot_options`

* [X] I have followed the instructions in the PR template
This commit is contained in:
lucasmerlin
2024-10-29 19:52:21 +01:00
committed by GitHub
parent 759a0b2a21
commit dafcfdad80
3 changed files with 197 additions and 36 deletions

View File

@@ -45,3 +45,9 @@ Running with `UPDATE_SNAPSHOTS=true` will still cause the tests to fail, but on
If you want to have multiple snapshots in the same test, it makes sense to collect the results in a `Vec`
([look here](https://github.com/emilk/egui/blob/70a01138b77f9c5724a35a6ef750b9ae1ab9f2dc/crates/egui_demo_lib/src/demo/demo_app_windows.rs#L388-L427) for an example).
This way they can all be updated at the same time.
You should add the following to your `.gitignore`:
```gitignore
**/tests/snapshots/**/*.diff.png
**/tests/snapshots/**/*.new.png
```