mirror of
https://github.com/emilk/egui.git
synced 2026-06-26 22:53:14 -04:00
With kittest it was difficult to wait for images to be loaded before taking a snapshot test. This PR adds `Harness::with_wait_for_pending_images` (true by default) which will cause `Harness::run` to sleep until all images are loaded (or `HarnessBuilder::with_max_steps` is exceeded). It also adds a new ImageLoader::has_pending and BytesLoader::has_pending, which should be implemented if things are loaded / decoded asynchronously. It reverts https://github.com/emilk/egui/pull/6901 which was my previous attempt to fix this (but this didn't work since only the tested crate is compiled with cfg(test) and not it's dependencies)
70 lines
2.0 KiB
TOML
70 lines
2.0 KiB
TOML
[package]
|
|
name = "egui_kittest"
|
|
version.workspace = true
|
|
authors = [
|
|
"Lucas Meurer <lucasmeurer96@gmail.com>",
|
|
"Emil Ernerfeldt <emil.ernerfeldt@gmail.com>",
|
|
]
|
|
description = "Testing library for egui based on kittest and AccessKit"
|
|
edition.workspace = true
|
|
rust-version.workspace = true
|
|
homepage = "https://github.com/emilk/egui"
|
|
license.workspace = true
|
|
readme = "./README.md"
|
|
repository = "https://github.com/emilk/egui"
|
|
categories = ["gui", "development-tools::testing", "accessibility"]
|
|
keywords = ["gui", "immediate", "egui", "testing", "accesskit"]
|
|
include = ["../LICENSE-APACHE", "../LICENSE-MIT", "**/*.rs", "Cargo.toml"]
|
|
|
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
|
|
[package.metadata.docs.rs]
|
|
all-features = true
|
|
rustdoc-args = ["--generate-link-to-definition"]
|
|
|
|
[features]
|
|
## Adds a wgpu-based test renderer.
|
|
wgpu = [
|
|
"dep:egui-wgpu",
|
|
"dep:pollster",
|
|
"dep:image",
|
|
"dep:wgpu",
|
|
"eframe?/wgpu",
|
|
]
|
|
|
|
## Adds a dify-based image snapshot utility.
|
|
snapshot = ["dep:dify", "dep:image", "image/png"]
|
|
|
|
## Allows testing eframe::App
|
|
eframe = ["dep:eframe", "eframe/accesskit"]
|
|
|
|
# This is just so it compiles with `--all-features` on Linux
|
|
x11 = ["eframe?/x11"]
|
|
|
|
|
|
[dependencies]
|
|
kittest.workspace = true
|
|
egui = { workspace = true, features = ["accesskit"] }
|
|
eframe = { workspace = true, optional = true }
|
|
|
|
# wgpu dependencies
|
|
egui-wgpu = { workspace = true, optional = true }
|
|
pollster = { workspace = true, optional = true }
|
|
image = { workspace = true, optional = true }
|
|
# Enable DX12 because it always comes with a software rasterizer.
|
|
wgpu = { workspace = true, features = ["metal", "dx12"], optional = true }
|
|
|
|
# snapshot dependencies
|
|
dify = { workspace = true, optional = true }
|
|
|
|
# Enable this when generating docs.
|
|
document-features = { workspace = true, optional = true }
|
|
|
|
[dev-dependencies]
|
|
egui = { workspace = true, features = ["default_fonts"] }
|
|
image = { workspace = true, features = ["png"] }
|
|
egui_extras = { workspace = true, features = ["image", "http"] }
|
|
|
|
[lints]
|
|
workspace = true
|