mirror of
https://github.com/emilk/egui.git
synced 2026-06-26 14:49:06 -04:00
Move the inspector to a separate repo
This commit is contained in:
27
Cargo.lock
27
Cargo.lock
@@ -1393,6 +1393,7 @@ name = "egui_kittest"
|
|||||||
version = "0.34.1"
|
version = "0.34.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"backtrace",
|
"backtrace",
|
||||||
|
"bincode 2.0.1",
|
||||||
"dify",
|
"dify",
|
||||||
"document-features",
|
"document-features",
|
||||||
"eframe",
|
"eframe",
|
||||||
@@ -1401,7 +1402,6 @@ dependencies = [
|
|||||||
"egui_extras",
|
"egui_extras",
|
||||||
"image",
|
"image",
|
||||||
"kittest",
|
"kittest",
|
||||||
"kittest_inspector",
|
|
||||||
"open",
|
"open",
|
||||||
"pollster",
|
"pollster",
|
||||||
"serde",
|
"serde",
|
||||||
@@ -1792,16 +1792,6 @@ dependencies = [
|
|||||||
"percent-encoding",
|
"percent-encoding",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "fs4"
|
|
||||||
version = "0.13.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "8640e34b88f7652208ce9e88b1a37a2ae95227d84abec377ccd3c5cfeb141ed4"
|
|
||||||
dependencies = [
|
|
||||||
"rustix 1.1.4",
|
|
||||||
"windows-sys 0.59.0",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "futures-core"
|
name = "futures-core"
|
||||||
version = "0.3.32"
|
version = "0.3.32"
|
||||||
@@ -2527,21 +2517,6 @@ dependencies = [
|
|||||||
"accesskit_consumer",
|
"accesskit_consumer",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "kittest_inspector"
|
|
||||||
version = "0.34.1"
|
|
||||||
dependencies = [
|
|
||||||
"accesskit",
|
|
||||||
"arboard",
|
|
||||||
"bincode 2.0.1",
|
|
||||||
"eframe",
|
|
||||||
"egui",
|
|
||||||
"egui_extras",
|
|
||||||
"fs4",
|
|
||||||
"image",
|
|
||||||
"serde",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "kurbo"
|
name = "kurbo"
|
||||||
version = "0.11.1"
|
version = "0.11.1"
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ members = [
|
|||||||
"crates/egui_extras",
|
"crates/egui_extras",
|
||||||
"crates/egui_glow",
|
"crates/egui_glow",
|
||||||
"crates/egui_kittest",
|
"crates/egui_kittest",
|
||||||
"crates/kittest_inspector",
|
|
||||||
"crates/egui-wgpu",
|
"crates/egui-wgpu",
|
||||||
"crates/egui-winit",
|
"crates/egui-winit",
|
||||||
"crates/egui",
|
"crates/egui",
|
||||||
@@ -68,7 +67,6 @@ egui_demo_lib = { version = "0.34.1", path = "crates/egui_demo_lib", default-fea
|
|||||||
egui_glow = { version = "0.34.1", path = "crates/egui_glow", default-features = false }
|
egui_glow = { version = "0.34.1", path = "crates/egui_glow", default-features = false }
|
||||||
egui_kittest = { version = "0.34.1", path = "crates/egui_kittest", default-features = false }
|
egui_kittest = { version = "0.34.1", path = "crates/egui_kittest", default-features = false }
|
||||||
eframe = { version = "0.34.1", path = "crates/eframe", default-features = false }
|
eframe = { version = "0.34.1", path = "crates/eframe", default-features = false }
|
||||||
kittest_inspector = { version = "0.34.1", path = "crates/kittest_inspector", default-features = false }
|
|
||||||
|
|
||||||
accesskit = "0.24.0"
|
accesskit = "0.24.0"
|
||||||
accesskit_consumer = "0.35.0"
|
accesskit_consumer = "0.35.0"
|
||||||
|
|||||||
@@ -29,8 +29,13 @@ snapshot = ["dep:dify", "dep:image", "dep:open", "dep:tempfile", "image/png"]
|
|||||||
## Record a test session as an animated GIF or PNG sequence.
|
## Record a test session as an animated GIF or PNG sequence.
|
||||||
recording = ["dep:image", "image/gif", "image/png"]
|
recording = ["dep:image", "image/gif", "image/png"]
|
||||||
|
|
||||||
|
## Expose the [`inspector_api`] wire protocol used to talk to the external
|
||||||
|
## `kittest_inspector` binary. Pull this in if you're building a tool that consumes
|
||||||
|
## the same stream — the binary itself enables this transitively.
|
||||||
|
inspector_api = ["dep:bincode", "egui/serde"]
|
||||||
|
|
||||||
## Stream frames + accesskit tree to a `kittest_inspector` window for live debugging.
|
## Stream frames + accesskit tree to a `kittest_inspector` window for live debugging.
|
||||||
inspector = ["dep:image", "dep:kittest_inspector", "dep:backtrace"]
|
inspector = ["inspector_api", "dep:image", "dep:backtrace"]
|
||||||
|
|
||||||
## Allows testing eframe::App
|
## Allows testing eframe::App
|
||||||
eframe = ["dep:eframe", "eframe/accesskit"]
|
eframe = ["dep:eframe", "eframe/accesskit"]
|
||||||
@@ -57,7 +62,7 @@ wgpu = { workspace = true, features = ["metal", "dx12", "vulkan", "gles"], optio
|
|||||||
dify = { workspace = true, optional = true }
|
dify = { workspace = true, optional = true }
|
||||||
|
|
||||||
# inspector dependencies
|
# inspector dependencies
|
||||||
kittest_inspector = { workspace = true, default-features = false, optional = true }
|
bincode = { workspace = true, optional = true }
|
||||||
backtrace = { workspace = true, optional = true }
|
backtrace = { workspace = true, optional = true }
|
||||||
|
|
||||||
# Enable this when generating docs.
|
# Enable this when generating docs.
|
||||||
|
|||||||
@@ -12,10 +12,10 @@ use std::sync::LazyLock;
|
|||||||
|
|
||||||
use egui::accesskit;
|
use egui::accesskit;
|
||||||
use egui::mutex::Mutex;
|
use egui::mutex::Mutex;
|
||||||
use kittest_inspector::{
|
|
||||||
|
use crate::inspector_api::{
|
||||||
Frame, HarnessMessage, InspectorReply, SourceView, read_message, write_message,
|
Frame, HarnessMessage, InspectorReply, SourceView, read_message, write_message,
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::node::EventSite;
|
use crate::node::EventSite;
|
||||||
|
|
||||||
/// Environment variable: when set to a truthy value, every harness auto-launches an inspector.
|
/// Environment variable: when set to a truthy value, every harness auto-launches an inspector.
|
||||||
@@ -238,7 +238,6 @@ fn is_user_code(path: &str) -> bool {
|
|||||||
"/.cargo/registry/",
|
"/.cargo/registry/",
|
||||||
"/.cargo/git/",
|
"/.cargo/git/",
|
||||||
"egui_kittest/src/",
|
"egui_kittest/src/",
|
||||||
"kittest_inspector/src/",
|
|
||||||
];
|
];
|
||||||
!EXCLUDE.iter().any(|needle| path.contains(needle))
|
!EXCLUDE.iter().any(|needle| path.contains(needle))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,23 @@
|
|||||||
//! Wire protocol for `kittest_inspector`.
|
//! Wire protocol shared between [`crate::Harness`] and the external `kittest_inspector`
|
||||||
|
//! binary (lives at <https://github.com/rerun-io/kittest_inspector>).
|
||||||
//!
|
//!
|
||||||
//! The harness launches `kittest_inspector` as a child process with piped stdin/stdout.
|
//! The harness spawns the inspector as a child process with piped stdin/stdout. For each
|
||||||
//! For each step, the harness writes a [`HarnessMessage`] to the child's stdin and reads an
|
//! step, the harness writes a [`HarnessMessage`] to the child's stdin and reads an
|
||||||
//! [`InspectorReply`] from its stdout. The inspector decides whether to reply immediately
|
//! [`InspectorReply`] from its stdout. The inspector decides whether to reply immediately
|
||||||
//! (playing) or to wait for the user to click Play/Next (paused).
|
//! (playing) or to wait for the user to click Play/Next (paused).
|
||||||
//!
|
//!
|
||||||
//! Messages are framed as a 4-byte big-endian length followed by a bincode-encoded body.
|
//! Messages are framed as a 4-byte big-endian length followed by a bincode-encoded body.
|
||||||
//! Anything the inspector wants to log goes to stderr (which the harness inherits), keeping
|
//! Anything the inspector wants to log goes to stderr (which the harness inherits), keeping
|
||||||
//! stdout reserved for protocol traffic.
|
//! stdout reserved for protocol traffic.
|
||||||
|
//!
|
||||||
|
//! Living inside `egui_kittest` (rather than the inspector crate) lets the inspector be
|
||||||
|
//! released independently — it just consumes whichever protocol version ships with the
|
||||||
|
//! egui release it was built against.
|
||||||
|
|
||||||
use std::io::{self, Read, Write};
|
use std::io::{self, Read, Write};
|
||||||
|
|
||||||
|
use egui::accesskit;
|
||||||
|
|
||||||
/// One source file plus the test-source lines the inspector should highlight inside it.
|
/// One source file plus the test-source lines the inspector should highlight inside it.
|
||||||
///
|
///
|
||||||
/// The harness walks each captured backtrace (for the `.run()` call that produced the frame
|
/// The harness walks each captured backtrace (for the `.run()` call that produced the frame
|
||||||
@@ -15,6 +15,8 @@ mod app_kind;
|
|||||||
mod config;
|
mod config;
|
||||||
#[cfg(feature = "inspector")]
|
#[cfg(feature = "inspector")]
|
||||||
mod inspector;
|
mod inspector;
|
||||||
|
#[cfg(feature = "inspector_api")]
|
||||||
|
pub mod inspector_api;
|
||||||
mod node;
|
mod node;
|
||||||
#[cfg(feature = "recording")]
|
#[cfg(feature = "recording")]
|
||||||
mod recording;
|
mod recording;
|
||||||
|
|||||||
@@ -1,46 +0,0 @@
|
|||||||
[package]
|
|
||||||
name = "kittest_inspector"
|
|
||||||
version.workspace = true
|
|
||||||
authors = ["Lucas Meurer <hi@lucasmerlin.me>"]
|
|
||||||
description = "Live inspector eframe app for egui_kittest tests (frame + accesskit tree + step controls)"
|
|
||||||
edition.workspace = true
|
|
||||||
rust-version.workspace = true
|
|
||||||
license.workspace = true
|
|
||||||
repository = "https://github.com/emilk/egui"
|
|
||||||
categories = ["gui", "development-tools::testing"]
|
|
||||||
keywords = ["egui", "kittest", "testing", "inspector"]
|
|
||||||
readme = "./README.md"
|
|
||||||
include = ["../../LICENSE-APACHE", "../../LICENSE-MIT", "**/*.rs", "Cargo.toml"]
|
|
||||||
|
|
||||||
[lib]
|
|
||||||
name = "kittest_inspector"
|
|
||||||
path = "src/lib.rs"
|
|
||||||
|
|
||||||
[[bin]]
|
|
||||||
name = "kittest_inspector"
|
|
||||||
path = "src/main.rs"
|
|
||||||
required-features = ["app"]
|
|
||||||
|
|
||||||
[features]
|
|
||||||
default = ["app"]
|
|
||||||
|
|
||||||
## Build the eframe inspector binary.
|
|
||||||
app = ["dep:eframe", "dep:egui_extras", "dep:fs4", "dep:image", "dep:arboard"]
|
|
||||||
|
|
||||||
[dependencies]
|
|
||||||
accesskit = { workspace = true, features = ["serde"] }
|
|
||||||
bincode = { workspace = true }
|
|
||||||
egui = { workspace = true, features = ["serde"] }
|
|
||||||
serde = { workspace = true }
|
|
||||||
|
|
||||||
# `app` feature dependencies:
|
|
||||||
eframe = { workspace = true, features = ["default_fonts", "wgpu"], optional = true }
|
|
||||||
egui_extras = { workspace = true, features = ["image"], optional = true }
|
|
||||||
fs4 = { workspace = true, optional = true }
|
|
||||||
image = { workspace = true, optional = true, features = ["gif"] }
|
|
||||||
# Cross-platform clipboard — same crate eframe uses — with `set_file_list` so apps that
|
|
||||||
# accept pasted files (Slack, Discord, Finder, etc.) attach the GIF with animation intact.
|
|
||||||
arboard = { workspace = true, optional = true }
|
|
||||||
|
|
||||||
[lints]
|
|
||||||
workspace = true
|
|
||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user