|
|
|
@@ -50,8 +50,8 @@ This is so that you can set `UPDATE_SNAPSHOTS=true` and update all tests, withou
|
|
|
|
|
If you want to update all snapshot images, even those that are within error margins,
|
|
|
|
|
run with `UPDATE_SNAPSHOTS=force`.
|
|
|
|
|
|
|
|
|
|
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).
|
|
|
|
|
If you want to have multiple snapshots in the same test, it makes sense to collect the results in a `SnapshotResults`
|
|
|
|
|
([look here](https://github.com/emilk/egui/blob/d1fcd740ded5d69016c993a502b52e67f5d492d7/crates/egui_demo_lib/src/demo/demo_app_windows.rs#L387-L420) for an example).
|
|
|
|
|
This way they can all be updated at the same time.
|
|
|
|
|
|
|
|
|
|
You should add the following to your `.gitignore`:
|
|
|
|
@@ -67,7 +67,7 @@ You should add the following to your `.gitignore`:
|
|
|
|
|
* …they are brittle since unrelated side effects (like a change in color) can cause the test to fail
|
|
|
|
|
* …images take up repo space
|
|
|
|
|
* images should…
|
|
|
|
|
* …be checked in or otherwise be available (egui use [git LFS](https://git-lfs.com/) files for this purpose)
|
|
|
|
|
* …be checked in or otherwise be available (egui uses [git LFS](https://git-lfs.com/) files for this purpose)
|
|
|
|
|
* …depict exactly what's tested and nothing else
|
|
|
|
|
* …have a low resolution to avoid growth in repo size
|
|
|
|
|
* …have a low comparison threshold to avoid the test passing despite unwanted differences (the default threshold should be fine for most usecases!)
|
|
|
|
|