diff --git a/crates/egui_kittest/src/app_kind.rs b/crates/egui_kittest/src/app_kind.rs index 42edd6d66..942ec4b85 100644 --- a/crates/egui_kittest/src/app_kind.rs +++ b/crates/egui_kittest/src/app_kind.rs @@ -10,6 +10,7 @@ type AppKindUi<'a> = Box; #[cfg(feature = "eframe")] pub(crate) struct AppKindEframe { pub get_app: fn(&mut State) -> &mut dyn eframe::App, + #[cfg(not(target_arch = "wasm32"))] pub take_app: fn(State) -> Box, pub frame: eframe::Frame, } diff --git a/crates/egui_kittest/src/builder.rs b/crates/egui_kittest/src/builder.rs index 58bfb8601..dc4757ee5 100644 --- a/crates/egui_kittest/src/builder.rs +++ b/crates/egui_kittest/src/builder.rs @@ -211,6 +211,7 @@ impl HarnessBuilder { let kind = AppKind::Eframe(AppKindEframe { get_app: |state| state, + #[cfg(not(target_arch = "wasm32"))] take_app: |state| Box::new(state), frame, }); diff --git a/crates/egui_kittest/src/lib.rs b/crates/egui_kittest/src/lib.rs index 4fa68d93c..2b7c4f8f3 100644 --- a/crates/egui_kittest/src/lib.rs +++ b/crates/egui_kittest/src/lib.rs @@ -711,7 +711,7 @@ impl<'a, State> Harness<'a, State> { /// Then write a `fn main()` in the test file that invokes your test directly. /// /// See also: - #[cfg(feature = "eframe")] + #[cfg(all(feature = "eframe", not(target_arch = "wasm32")))] #[deprecated = "Only for debugging, don't commit this."] pub fn spawn_eframe_app(self) where