diff --git a/crates/egui_demo_lib/src/demo/demo_app_windows.rs b/crates/egui_demo_lib/src/demo/demo_app_windows.rs index 6a6becd599d..790e7289953 100644 --- a/crates/egui_demo_lib/src/demo/demo_app_windows.rs +++ b/crates/egui_demo_lib/src/demo/demo_app_windows.rs @@ -383,7 +383,7 @@ mod tests { use crate::demo::demo_app_windows::Demos; use egui::Vec2; use egui_kittest::kittest::Queryable; - use egui_kittest::Harness; + use egui_kittest::{Harness, SnapshotOptions}; #[test] fn demos_should_match_snapshot() { @@ -417,7 +417,13 @@ mod tests { // Run the app for some more frames... harness.run(); - let result = harness.try_wgpu_snapshot(&format!("demos/{name}")); + let mut options = SnapshotOptions::default(); + // The Bézier Curve demo needs a threshold of 2.1 to pass on linux + if name == "Bézier Curve" { + options.threshold = 2.1; + } + + let result = harness.try_wgpu_snapshot_options(&format!("demos/{name}"), &options); if let Err(err) = result { errors.push(err); } diff --git a/crates/egui_kittest/README.md b/crates/egui_kittest/README.md index 967037266fe..db07f7e8d99 100644 --- a/crates/egui_kittest/README.md +++ b/crates/egui_kittest/README.md @@ -47,7 +47,7 @@ If you want to have multiple snapshots in the same test, it makes sense to colle 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 -``` \ No newline at end of file +```