Fix standalone compilation of iced_test subcrate
This commit is contained in:
parent
6ad39fe544
commit
b11ad9ff5e
5 changed files with 35 additions and 4 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
|
@ -2502,6 +2502,7 @@ dependencies = [
|
||||||
name = "iced_test"
|
name = "iced_test"
|
||||||
version = "0.14.0-dev"
|
version = "0.14.0-dev"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"iced_futures",
|
||||||
"iced_program",
|
"iced_program",
|
||||||
"iced_renderer",
|
"iced_renderer",
|
||||||
"iced_runtime",
|
"iced_runtime",
|
||||||
|
|
|
||||||
|
|
@ -259,3 +259,29 @@ impl svg::Renderer for () {
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl renderer::Headless for () {
|
||||||
|
async fn new(
|
||||||
|
_default_font: Font,
|
||||||
|
_default_text_size: Pixels,
|
||||||
|
_backend: Option<&str>,
|
||||||
|
) -> Option<Self>
|
||||||
|
where
|
||||||
|
Self: Sized,
|
||||||
|
{
|
||||||
|
Some(())
|
||||||
|
}
|
||||||
|
|
||||||
|
fn name(&self) -> String {
|
||||||
|
"null renderer".to_owned()
|
||||||
|
}
|
||||||
|
|
||||||
|
fn screenshot(
|
||||||
|
&mut self,
|
||||||
|
_size: Size<u32>,
|
||||||
|
_scale_factor: f32,
|
||||||
|
_background_color: Color,
|
||||||
|
) -> Vec<u8> {
|
||||||
|
Vec::new()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,9 @@ iced_runtime.workspace = true
|
||||||
iced_program.workspace = true
|
iced_program.workspace = true
|
||||||
iced_selector.workspace = true
|
iced_selector.workspace = true
|
||||||
|
|
||||||
|
iced_futures.workspace = true
|
||||||
|
iced_futures.features = ["thread-pool"]
|
||||||
|
|
||||||
iced_renderer.workspace = true
|
iced_renderer.workspace = true
|
||||||
iced_renderer.features = ["fira-sans"]
|
iced_renderer.features = ["fira-sans"]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,7 @@
|
||||||
//! [`typewrite`](Simulator::typewrite)—and even perform [_snapshot testing_](Simulator::snapshot)!
|
//! [`typewrite`](Simulator::typewrite)—and even perform [_snapshot testing_](Simulator::snapshot)!
|
||||||
//!
|
//!
|
||||||
//! [the classical counter interface]: https://book.iced.rs/architecture.html#dissecting-an-interface
|
//! [the classical counter interface]: https://book.iced.rs/architecture.html#dissecting-an-interface
|
||||||
|
pub use iced_futures as futures;
|
||||||
pub use iced_program as program;
|
pub use iced_program as program;
|
||||||
pub use iced_renderer as renderer;
|
pub use iced_renderer as renderer;
|
||||||
pub use iced_runtime as runtime;
|
pub use iced_runtime as runtime;
|
||||||
|
|
@ -122,9 +123,9 @@ pub fn run(
|
||||||
program: impl program::Program + 'static,
|
program: impl program::Program + 'static,
|
||||||
tests_dir: impl AsRef<Path>,
|
tests_dir: impl AsRef<Path>,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
use crate::runtime::futures::futures::StreamExt;
|
use crate::futures::futures::StreamExt;
|
||||||
use crate::runtime::futures::futures::channel::mpsc;
|
use crate::futures::futures::channel::mpsc;
|
||||||
use crate::runtime::futures::futures::executor;
|
use crate::futures::futures::executor;
|
||||||
|
|
||||||
use std::ffi::OsStr;
|
use std::ffi::OsStr;
|
||||||
use std::fs;
|
use std::fs;
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ where
|
||||||
let mut renderer = {
|
let mut renderer = {
|
||||||
let backend = env::var("ICED_TEST_BACKEND").ok();
|
let backend = env::var("ICED_TEST_BACKEND").ok();
|
||||||
|
|
||||||
iced_runtime::futures::futures::executor::block_on(Renderer::new(
|
crate::futures::futures::executor::block_on(Renderer::new(
|
||||||
default_font,
|
default_font,
|
||||||
settings.default_text_size,
|
settings.default_text_size,
|
||||||
backend.as_deref(),
|
backend.as_deref(),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue