1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 14:20:04 -04:00

Add egui_kittest::Harness::set_options (#7638)

Makes it easier to set the same options for many tests

---------

Co-authored-by: Lucas Meurer <hi@lucasmerlin.me>
This commit is contained in:
Emil Ernerfeldt
2025-10-15 11:42:52 +02:00
committed by GitHub
parent 96470fabee
commit c79096ecc4
3 changed files with 39 additions and 1 deletions

View File

@@ -75,6 +75,9 @@ pub struct Harness<'a, State = ()> {
step_dt: f32,
wait_for_pending_images: bool,
queued_events: EventQueue,
#[cfg(feature = "snapshot")]
default_snapshot_options: SnapshotOptions,
}
impl<State> Debug for Harness<'_, State> {
@@ -100,6 +103,9 @@ impl<'a, State> Harness<'a, State> {
state: _,
mut renderer,
wait_for_pending_images,
#[cfg(feature = "snapshot")]
default_snapshot_options,
} = builder;
let ctx = ctx.unwrap_or_default();
ctx.set_theme(theme);
@@ -147,6 +153,9 @@ impl<'a, State> Harness<'a, State> {
step_dt,
wait_for_pending_images,
queued_events: Default::default(),
#[cfg(feature = "snapshot")]
default_snapshot_options,
};
// Run the harness until it is stable, ensuring that all Areas are shown and animations are done
harness.run_ok();