From 3b5ee7f47d5f4d38ecfafadb66e6c0516310bc54 Mon Sep 17 00:00:00 2001 From: Lucas Meurer Date: Sat, 5 Oct 2024 13:13:16 +0200 Subject: [PATCH] Always run egui_demo_lib tests with chrono feature --- Cargo.lock | 1 + crates/egui_demo_lib/Cargo.toml | 3 +++ crates/egui_demo_lib/tests/snapshots/demos/Widget Gallery.png | 4 ++-- crates/egui_demo_lib/tests/snapshots/widget_gallery.png | 4 ++-- crates/egui_kittest/src/snapshot.rs | 1 + 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 718fbafd1555..2a33ba9e0705 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1334,6 +1334,7 @@ dependencies = [ "criterion", "document-features", "egui", + "egui_demo_lib", "egui_extras", "egui_kittest", "log", diff --git a/crates/egui_demo_lib/Cargo.toml b/crates/egui_demo_lib/Cargo.toml index 38ff19fe9066..ebe2868fe0c2 100644 --- a/crates/egui_demo_lib/Cargo.toml +++ b/crates/egui_demo_lib/Cargo.toml @@ -56,6 +56,9 @@ serde = { workspace = true, optional = true } [dev-dependencies] +# when running tests we always want to use the `chrono` feature +egui_demo_lib = { features = ["chrono"], workspace = true } + criterion.workspace = true egui_kittest = { path = "../egui_kittest", features = ["wgpu", "snapshot"] } wgpu = { workspace = true, features = ["metal"] } diff --git a/crates/egui_demo_lib/tests/snapshots/demos/Widget Gallery.png b/crates/egui_demo_lib/tests/snapshots/demos/Widget Gallery.png index f1b29751af84..da7f58d44f45 100644 --- a/crates/egui_demo_lib/tests/snapshots/demos/Widget Gallery.png +++ b/crates/egui_demo_lib/tests/snapshots/demos/Widget Gallery.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8e376aaa97574d8c0fca3b331a39dcaadbc463ef06026512e71e93d559539d9d -size 101513 +oid sha256:c3b604629cdb4f9d48c2bb1b30e0650da38a50f130ac10b64defb5334e8a2b90 +size 106900 diff --git a/crates/egui_demo_lib/tests/snapshots/widget_gallery.png b/crates/egui_demo_lib/tests/snapshots/widget_gallery.png index 88b0bccb38bc..29574beb03e9 100644 --- a/crates/egui_demo_lib/tests/snapshots/widget_gallery.png +++ b/crates/egui_demo_lib/tests/snapshots/widget_gallery.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bceac96a5fb9eaf4660e7d646f3694955aa31f63004966789a032f0a606bd644 -size 166348 +oid sha256:1e3c37b58611bf14983b87320a220a8befa81273c05cbcb073399c13f6d5b630 +size 177431 diff --git a/crates/egui_kittest/src/snapshot.rs b/crates/egui_kittest/src/snapshot.rs index e67a8a3cf04e..7afd7b65e64a 100644 --- a/crates/egui_kittest/src/snapshot.rs +++ b/crates/egui_kittest/src/snapshot.rs @@ -72,6 +72,7 @@ pub fn try_image_snapshot(current: &image::RgbaImage, name: &str) -> Result<(), /// /// # Panics /// Panics if the image does not match the snapshot. +#[track_caller] pub fn image_snapshot(current: &image::RgbaImage, name: &str) { match try_image_snapshot(current, name) { Ok(_) => {}