Skip to content

Commit

Permalink
Review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmerlin committed Oct 12, 2024
1 parent ddf79ce commit 148e79a
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
**/target
**/target_ra
**/target_wasm
**/tests/snapshots/**/*.diff.png
**/tests/snapshots/**/*.new.png
/.*.json
/.vscode
/media/*
.idea/
**/tests/snapshots/**/*.new.png
**/tests/snapshots/**/*.diff.png
2 changes: 1 addition & 1 deletion Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1384,8 +1384,8 @@ dependencies = [
name = "egui_kittest"
version = "0.29.1"
dependencies = [
"accesskit_consumer",
"dify",
"document-features",
"egui",
"egui-wgpu",
"image",
Expand Down
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,18 @@ ahash = { version = "0.8.11", default-features = false, features = [
backtrace = "0.3"
bytemuck = "1.7.2"
criterion = { version = "0.5.1", default-features = false }
dify = { version = "0.7", default-features = false }
document-features = " 0.2.8"
glow = "0.14"
glutin = "0.32.0"
glutin-winit = "0.5.0"
home = "0.5.9"
image = { version = "0.25", default-features = false }
kittest = { git = "https://github.com/rerun-io/kittest", version = "0.1", branch = "main"}
log = { version = "0.4", features = ["std"] }
nohash-hasher = "0.2"
parking_lot = "0.12"
pollster = "0.3"
puffin = "0.19"
puffin_http = "0.16"
ron = "0.8"
Expand Down
4 changes: 2 additions & 2 deletions crates/egui_demo_lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ serde = { workspace = true, optional = true }

[dev-dependencies]
# when running tests we always want to use the `chrono` feature
egui_demo_lib = { features = ["chrono"], workspace = true }
egui_demo_lib = { workspace = true, features = ["chrono"] }

criterion.workspace = true
egui_kittest = { workspace = true, features = ["default", "wgpu", "snapshot"] }
egui_kittest = { workspace = true, features = ["wgpu", "snapshot"] }
wgpu = { workspace = true, features = ["metal"] }
egui = { workspace = true, features = ["default_fonts"] }

Expand Down
28 changes: 20 additions & 8 deletions crates/egui_kittest/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,30 +1,42 @@
[package]
name = "egui_kittest"
version.workspace = true
authors = ["Lucas Meurer <[email protected]>", "Emil Ernerfeldt <[email protected]>"]
description = "Testing library for egui based on kittest and AccessKit"
edition.workspace = true
license.workspace = true
rust-version.workspace = true
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

[features]
# Adds a wgpu-based test renderer.
wgpu = ["dep:egui-wgpu", "dep:pollster", "dep:image"]
snapshot = ["dep:dify"]

default = ["image?/png"]
# Adds a dify-based image snapshot utility.
snapshot = ["dep:dify", "dep:image", "image/png"]


[dependencies]
accesskit_consumer = "0.24.0"
kittest = { git = "https://github.com/rerun-io/kittest", version = "0.1", branch = "main" }
kittest.workspace = true
egui = { workspace = true, features = ["accesskit"] }

# wgpu dependencies
egui-wgpu = { workspace = true, optional = true }
pollster = { version = "0.3", optional = true }
pollster = { workspace = true, optional = true }
image = { workspace = true, optional = true }

# snapshot dependencies
dify = { version = "0.7.0", optional = true, default-features = false }
dify = { workspace = true, optional = true }

## Enable this when generating docs.
document-features = { workspace = true, optional = true }

[dev-dependencies]
wgpu = { workspace = true, features = ["metal"] }
Expand Down
2 changes: 1 addition & 1 deletion crates/egui_kittest/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# egui_kittest

Ui testing library for egui, based on [kittest](https://github.com/rerun-io/kittest) (a AccessKit based testing library).
Ui testing library for egui, based on [kittest](https://github.com/rerun-io/kittest) (an [AccessKit](https://github.com/AccessKit/accesskit) based testing library).

```rust
use egui::accesskit::{Role, Toggled};
Expand Down
2 changes: 1 addition & 1 deletion crates/egui_kittest/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ impl Default for HarnessBuilder {
impl HarnessBuilder {
/// Set the size of the window.
#[inline]
pub fn with_size(mut self, size: Vec2) -> Self {
pub fn with_size(mut self, size: impl Into<Vec2>) -> Self {
self.screen_rect.set_width(size.x);
self.screen_rect.set_height(size.y);
self
Expand Down
5 changes: 4 additions & 1 deletion crates/egui_kittest/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#![doc = include_str!("../README.md")]
//!
//! ## Feature flags
#![cfg_attr(feature = "document-features", doc = document_features::document_features!())]

mod builder;
mod event;
#[cfg(feature = "snapshot")]
Expand All @@ -16,7 +20,6 @@ pub use kittest;
use std::mem;

use crate::event::EventState;
pub use accesskit_consumer;
pub use builder::*;
use egui::{Pos2, Rect, TexturesDelta, Vec2, ViewportId};
use kittest::{Node, Queryable};
Expand Down

0 comments on commit 148e79a

Please sign in to comment.