mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-27 06:30:20 +00:00
don't render headless tests
This commit is contained in:
parent
ea5e664364
commit
ae71e4ce33
2 changed files with 12 additions and 2 deletions
|
@ -3,6 +3,8 @@ use dioxus::prelude::*;
|
||||||
use dioxus_desktop::DesktopContext;
|
use dioxus_desktop::DesktopContext;
|
||||||
|
|
||||||
pub(crate) fn check_app_exits(app: Component) {
|
pub(crate) fn check_app_exits(app: Component) {
|
||||||
|
use dioxus_desktop::tao::window::WindowBuilder;
|
||||||
|
use dioxus_desktop::Config;
|
||||||
// This is a deadman's switch to ensure that the app exits
|
// This is a deadman's switch to ensure that the app exits
|
||||||
let should_panic = std::sync::Arc::new(std::sync::atomic::AtomicBool::new(true));
|
let should_panic = std::sync::Arc::new(std::sync::atomic::AtomicBool::new(true));
|
||||||
let should_panic_clone = should_panic.clone();
|
let should_panic_clone = should_panic.clone();
|
||||||
|
@ -13,7 +15,10 @@ pub(crate) fn check_app_exits(app: Component) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
dioxus_desktop::launch(app);
|
dioxus_desktop::launch_cfg(
|
||||||
|
app,
|
||||||
|
Config::new().with_window(WindowBuilder::new().with_visible(false)),
|
||||||
|
);
|
||||||
|
|
||||||
should_panic.store(false, std::sync::atomic::Ordering::SeqCst);
|
should_panic.store(false, std::sync::atomic::Ordering::SeqCst);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,8 @@ use dioxus::prelude::*;
|
||||||
use dioxus_desktop::DesktopContext;
|
use dioxus_desktop::DesktopContext;
|
||||||
|
|
||||||
pub(crate) fn check_app_exits(app: Component) {
|
pub(crate) fn check_app_exits(app: Component) {
|
||||||
|
use dioxus_desktop::tao::window::WindowBuilder;
|
||||||
|
use dioxus_desktop::Config;
|
||||||
// This is a deadman's switch to ensure that the app exits
|
// This is a deadman's switch to ensure that the app exits
|
||||||
let should_panic = std::sync::Arc::new(std::sync::atomic::AtomicBool::new(true));
|
let should_panic = std::sync::Arc::new(std::sync::atomic::AtomicBool::new(true));
|
||||||
let should_panic_clone = should_panic.clone();
|
let should_panic_clone = should_panic.clone();
|
||||||
|
@ -12,7 +14,10 @@ pub(crate) fn check_app_exits(app: Component) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
dioxus_desktop::launch(app);
|
dioxus_desktop::launch_cfg(
|
||||||
|
app,
|
||||||
|
Config::new().with_window(WindowBuilder::new().with_visible(false)),
|
||||||
|
);
|
||||||
|
|
||||||
should_panic.store(false, std::sync::atomic::Ordering::SeqCst);
|
should_panic.store(false, std::sync::atomic::Ordering::SeqCst);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue