Skip to content

Commit

Permalink
Change threshold for Bézier Curve test
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmerlin committed Oct 24, 2024
1 parent 4cc8ff8 commit e775c6f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 8 additions & 2 deletions crates/egui_demo_lib/src/demo/demo_app_windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions crates/egui_kittest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
```

0 comments on commit e775c6f

Please sign in to comment.