diff --git a/.non-vite.clippy.toml b/.non-vite.clippy.toml index 981abd8fa..1d66e21ef 100644 --- a/.non-vite.clippy.toml +++ b/.non-vite.clippy.toml @@ -1,5 +1,5 @@ -# Clippy configuration for non-vt crates (fspy_*, subprocess_test, pty_terminal, etc.) -# that don't depend on vt_str/vt_path. +# Clippy configuration for crates that don't depend on vt_str/vt_path +# (fspy_*, vt_subprocess_test, vt_pty_terminal, etc.). # # This is a subset of the root .clippy.toml, with rules recommending vt_str/vt_path # alternatives removed. Generic rules (cow_utils, rustc-hash) still apply. diff --git a/Cargo.lock b/Cargo.lock index 1e213a895..11749ca95 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1352,14 +1352,12 @@ dependencies = [ "fspy_test_bin", "futures-util", "libc", - "materialized_artifact", "nix 0.31.2", "ntapi", "ntest", "ouroboros", "rustc-hash", "sha2 0.11.0", - "subprocess_test", "tar", "tempfile", "test-log", @@ -1367,6 +1365,8 @@ dependencies = [ "tokio", "tokio-util", "vt_casefold", + "vt_materialized_artifact", + "vt_subprocess_test", "which", "winapi", "wincode", @@ -1529,12 +1529,12 @@ dependencies = [ "fspy_shm", "omnipath", "rustc-hash", - "subprocess_test", "thiserror 2.0.18", "tokio", "uuid", "vt_ipc_str", "vt_path", + "vt_subprocess_test", "winapi", "wincode", ] @@ -1564,8 +1564,8 @@ version = "0.0.0" dependencies = [ "ctor", "fspy_nostd", - "subprocess_test", "tempfile", + "vt_subprocess_test", "windows-sys 0.61.2", ] @@ -2450,24 +2450,6 @@ dependencies = [ "regex-automata", ] -[[package]] -name = "materialized_artifact" -version = "0.0.0" -dependencies = [ - "materialized_artifact_macros", - "tempfile", -] - -[[package]] -name = "materialized_artifact_macros" -version = "0.0.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", - "xxhash-rust", -] - [[package]] name = "memchr" version = "2.8.0" @@ -3282,13 +3264,6 @@ dependencies = [ "zerocopy", ] -[[package]] -name = "preload_test_lib" -version = "0.0.0" -dependencies = [ - "libc", -] - [[package]] name = "pretty_assertions" version = "1.4.1" @@ -3340,45 +3315,6 @@ dependencies = [ "yansi", ] -[[package]] -name = "pty_terminal" -version = "0.0.0" -dependencies = [ - "anyhow", - "ctor", - "ctrlc", - "nix 0.31.2", - "ntest", - "portable-pty", - "signal-hook 0.4.4", - "subprocess_test", - "terminal_size", - "vt100", -] - -[[package]] -name = "pty_terminal_test" -version = "0.0.0" -dependencies = [ - "anyhow", - "crossterm", - "ctor", - "ntest", - "portable-pty", - "pty_terminal", - "pty_terminal_test_client", - "subprocess_test", -] - -[[package]] -name = "pty_terminal_test_client" -version = "0.0.0" -dependencies = [ - "base64 0.22.1", - "getrandom 0.4.2", - "winapi", -] - [[package]] name = "quote" version = "1.0.45" @@ -4157,15 +4093,6 @@ version = "2.0.0-alpha.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef784004ca8777809dcdad6ac37629f0a97caee4c685fcea805278d81dd8b857" -[[package]] -name = "snapshot_test" -version = "0.1.0" -dependencies = [ - "serde", - "serde_json", - "similar 3.1.0", -] - [[package]] name = "socket2" version = "0.6.2" @@ -4176,18 +4103,6 @@ dependencies = [ "windows-sys 0.60.2", ] -[[package]] -name = "socket_ipc" -version = "0.0.0" -dependencies = [ - "nix 0.31.2", - "tempfile", - "tokio", - "uuid", - "vt_path", - "winapi", -] - [[package]] name = "sqlite-wasm-rs" version = "0.5.3" @@ -4258,18 +4173,6 @@ dependencies = [ "syn 2.0.117", ] -[[package]] -name = "subprocess_test" -version = "0.0.0" -dependencies = [ - "base64 0.22.1", - "ctor", - "fspy", - "portable-pty", - "rustc-hash", - "wincode", -] - [[package]] name = "subtle" version = "2.6.1" @@ -5022,12 +4925,10 @@ dependencies = [ "derive_more", "fspy", "futures-util", - "materialized_artifact", "nix 0.31.2", "once_cell", "owo-colors", "petgraph", - "pty_terminal_test_client", "rayon", "rusqlite", "rustc-hash", @@ -5047,8 +4948,10 @@ dependencies = [ "vt_glob", "vt_graph", "vt_ipc_shared", + "vt_materialized_artifact", "vt_path", "vt_plan", + "vt_pty_terminal_test_client", "vt_remote_cache", "vt_select", "vt_server", @@ -5087,21 +4990,21 @@ dependencies = [ "libtest-mimic", "nix 0.31.2", "notify", - "preload_test_lib", - "pty_terminal", - "pty_terminal_test", - "pty_terminal_test_client", "regex", "serde", "serde_json", "shell-escape", - "snapshot_test", "tempfile", "tokio", "toml", "vec1", "vt", "vt_path", + "vt_preload_test_lib", + "vt_pty_terminal", + "vt_pty_terminal_test", + "vt_pty_terminal_test_client", + "vt_snapshot_test", "vt_str", "vt_workspace", "which", @@ -5122,11 +5025,11 @@ name = "vt_client" version = "0.0.0" dependencies = [ "rustc-hash", - "socket_ipc", "vt_casefold", "vt_ipc_shared", "vt_ipc_str", "vt_path", + "vt_socket_ipc", "wincode", ] @@ -5203,6 +5106,24 @@ dependencies = [ "wincode", ] +[[package]] +name = "vt_materialized_artifact" +version = "0.0.0" +dependencies = [ + "tempfile", + "vt_materialized_artifact_macros", +] + +[[package]] +name = "vt_materialized_artifact_macros" +version = "0.0.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", + "xxhash-rust", +] + [[package]] name = "vt_path" version = "0.1.0" @@ -5238,7 +5159,6 @@ dependencies = [ "serde_json", "sha2 0.11.0", "shell-escape", - "snapshot_test", "tempfile", "thiserror 2.0.18", "tokio", @@ -5253,6 +5173,7 @@ dependencies = [ "vt_path", "vt_powershell", "vt_shell", + "vt_snapshot_test", "vt_str", "vt_workspace", "which", @@ -5268,6 +5189,52 @@ dependencies = [ "which", ] +[[package]] +name = "vt_preload_test_lib" +version = "0.0.0" +dependencies = [ + "libc", +] + +[[package]] +name = "vt_pty_terminal" +version = "0.0.0" +dependencies = [ + "anyhow", + "ctor", + "ctrlc", + "nix 0.31.2", + "ntest", + "portable-pty", + "signal-hook 0.4.4", + "terminal_size", + "vt100", + "vt_subprocess_test", +] + +[[package]] +name = "vt_pty_terminal_test" +version = "0.0.0" +dependencies = [ + "anyhow", + "crossterm", + "ctor", + "ntest", + "portable-pty", + "vt_pty_terminal", + "vt_pty_terminal_test_client", + "vt_subprocess_test", +] + +[[package]] +name = "vt_pty_terminal_test_client" +version = "0.0.0" +dependencies = [ + "base64 0.22.1", + "getrandom 0.4.2", + "winapi", +] + [[package]] name = "vt_remote_cache" version = "0.0.0" @@ -5305,7 +5272,6 @@ version = "0.0.0" dependencies = [ "futures", "rustc-hash", - "socket_ipc", "thiserror 2.0.18", "tokio", "tokio-util", @@ -5316,6 +5282,7 @@ dependencies = [ "vt_ipc_shared", "vt_ipc_str", "vt_path", + "vt_socket_ipc", "wincode", ] @@ -5330,6 +5297,27 @@ dependencies = [ "vt_str", ] +[[package]] +name = "vt_snapshot_test" +version = "0.1.0" +dependencies = [ + "serde", + "serde_json", + "similar 3.1.0", +] + +[[package]] +name = "vt_socket_ipc" +version = "0.0.0" +dependencies = [ + "nix 0.31.2", + "tempfile", + "tokio", + "uuid", + "vt_path", + "winapi", +] + [[package]] name = "vt_str" version = "0.1.0" @@ -5341,6 +5329,18 @@ dependencies = [ "wincode", ] +[[package]] +name = "vt_subprocess_test" +version = "0.0.0" +dependencies = [ + "base64 0.22.1", + "ctor", + "fspy", + "portable-pty", + "rustc-hash", + "wincode", +] + [[package]] name = "vt_tui" version = "0.0.0" diff --git a/Cargo.toml b/Cargo.toml index 39890d20a..ebd5a3d14 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -74,8 +74,6 @@ derive_more = "2.0.1" diff-struct = "0.5.3" directories = "6.0.0" elf = { version = "0.8.0", default-features = false } -materialized_artifact = { path = "crates/materialized_artifact" } -materialized_artifact_macros = { path = "crates/materialized_artifact_macros" } flate2 = "1.0.35" fspy = { path = "crates/fspy" } fspy_benchmark_launcher = { path = "crates/fspy_benchmark_launcher", artifact = "bin" } @@ -119,9 +117,6 @@ phf = "0.13.0" portable-pty = "0.9.0" pretty_assertions = "1.4.1" proc-macro2 = "1" -pty_terminal = { path = "crates/pty_terminal" } -pty_terminal_test = { path = "crates/pty_terminal_test" } -pty_terminal_test_client = { path = "crates/pty_terminal_test_client" } quote = "1" ratatui = "0.30.0" rayon = "1.10.0" @@ -144,10 +139,7 @@ fspy_nostd_alloc = { path = "crates/fspy_nostd_alloc" } similar = "3.0.0" smallvec = "2.0.0-alpha.12" static_cell = "2" -snapshot_test = { path = "crates/snapshot_test" } -socket_ipc = { path = "crates/socket_ipc" } stackalloc = "1.2.1" -subprocess_test = { path = "crates/subprocess_test" } supports-color = "3.0.1" syn = "2" syscalls = { version = "0.8.0", default-features = false } @@ -169,12 +161,20 @@ vec1 = "1.12.1" vt_casefold = { path = "crates/vt_casefold" } vt_glob = { path = "crates/vt_glob" } vt_graph_ser = { path = "crates/vt_graph_ser" } +vt_materialized_artifact = { path = "crates/vt_materialized_artifact" } +vt_materialized_artifact_macros = { path = "crates/vt_materialized_artifact_macros" } vt_path = { path = "crates/vt_path" } vt_powershell = { path = "crates/vt_powershell" } +vt_pty_terminal = { path = "crates/vt_pty_terminal" } +vt_pty_terminal_test = { path = "crates/vt_pty_terminal_test" } +vt_pty_terminal_test_client = { path = "crates/vt_pty_terminal_test_client" } vt_remote_cache = { path = "crates/vt_remote_cache" } vt_select = { path = "crates/vt_select" } vt_shell = { path = "crates/vt_shell" } +vt_snapshot_test = { path = "crates/vt_snapshot_test" } +vt_socket_ipc = { path = "crates/vt_socket_ipc" } vt_str = { path = "crates/vt_str" } +vt_subprocess_test = { path = "crates/vt_subprocess_test" } vt = { path = "crates/vt" } vt_bin = { path = "crates/vt_bin" } vt_client = { path = "crates/vt_client" } diff --git a/crates/fspy/Cargo.toml b/crates/fspy/Cargo.toml index 97de698cf..16683d743 100644 --- a/crates/fspy/Cargo.toml +++ b/crates/fspy/Cargo.toml @@ -11,7 +11,7 @@ wincode = { workspace = true } bstr = { workspace = true, features = ["alloc", "std"] } bumpalo = { workspace = true, features = ["allocator-api2", "collections"] } derive_more = { workspace = true, features = ["debug"] } -materialized_artifact = { workspace = true } +vt_materialized_artifact = { workspace = true } fspy_shared = { workspace = true } futures-util = { workspace = true } libc = { workspace = true } @@ -62,7 +62,7 @@ anyhow = { workspace = true } csv-async = { workspace = true, features = ["tokio"] } ctor = { workspace = true } ntest = { workspace = true } -subprocess_test = { workspace = true, features = ["fspy"] } +vt_subprocess_test = { workspace = true, features = ["fspy"] } test-log = { workspace = true, features = ["trace"] } tokio = { workspace = true, features = ["rt-multi-thread", "macros", "fs", "io-std"] } diff --git a/crates/fspy/build.rs b/crates/fspy/build.rs index 7675d6dab..d6d6982b9 100644 --- a/crates/fspy/build.rs +++ b/crates/fspy/build.rs @@ -56,7 +56,7 @@ struct BinaryDownload { /// On-disk filename in `OUT_DIR`. name: &'static str, /// Env var published via `cargo:rustc-env`, through which - /// `materialized_artifact::artifact!` finds and embeds the binary. + /// `vt_materialized_artifact::artifact!` finds and embeds the binary. env_var: &'static str, /// GitHub release asset URL. url: &'static str, diff --git a/crates/fspy/src/unix/macos_artifacts.rs b/crates/fspy/src/unix/macos_artifacts.rs index a8a388837..c348f0649 100644 --- a/crates/fspy/src/unix/macos_artifacts.rs +++ b/crates/fspy/src/unix/macos_artifacts.rs @@ -1,4 +1,4 @@ -use materialized_artifact::{Artifact, artifact}; +use vt_materialized_artifact::{Artifact, artifact}; pub const COREUTILS_BINARY: Artifact = artifact!("coreutils", "FSPY_MACOS_ARTIFACT_COREUTILS"); pub const OILS_BINARY: Artifact = artifact!("oils_for_unix", "FSPY_MACOS_ARTIFACT_OILS_FOR_UNIX"); diff --git a/crates/fspy/src/unix/mod.rs b/crates/fspy/src/unix/mod.rs index 7fdc7306a..4a83971c7 100644 --- a/crates/fspy/src/unix/mod.rs +++ b/crates/fspy/src/unix/mod.rs @@ -52,7 +52,7 @@ impl SpyImpl { pub fn init_in(#[cfg_attr(target_env = "musl", allow(unused))] dir: &Path) -> io::Result { #[cfg(not(target_env = "musl"))] let preload_path = { - use materialized_artifact::{Artifact, artifact}; + use vt_materialized_artifact::{Artifact, artifact}; const PRELOAD_CDYLIB: Artifact = artifact!("fspy_preload", "CARGO_CDYLIB_FILE_FSPY_PRELOAD_UNIX"); diff --git a/crates/fspy/src/windows/mod.rs b/crates/fspy/src/windows/mod.rs index 933b448ca..15533b7bb 100644 --- a/crates/fspy/src/windows/mod.rs +++ b/crates/fspy/src/windows/mod.rs @@ -15,9 +15,9 @@ use fspy_shared::{ windows::{PAYLOAD_ID, Payload}, }; use futures_util::FutureExt; -use materialized_artifact::{Artifact, artifact}; use ntapi::{ntpsapi::NtResumeProcess, ntrtl::RtlNtStatusToDosError}; use tokio_util::sync::CancellationToken; +use vt_materialized_artifact::{Artifact, artifact}; use winapi::{ shared::{minwindef::TRUE, ntdef::NT_SUCCESS}, um::winbase::CREATE_SUSPENDED, diff --git a/crates/fspy/tests/cancellation.rs b/crates/fspy/tests/cancellation.rs index ff65cf2c0..327de7af7 100644 --- a/crates/fspy/tests/cancellation.rs +++ b/crates/fspy/tests/cancellation.rs @@ -5,7 +5,7 @@ use tokio_util::sync::CancellationToken; #[test_log::test(tokio::test)] async fn cancellation_kills_tracked_child() -> anyhow::Result<()> { - let cmd = subprocess_test::command_for_fn!((), |()| { + let cmd = vt_subprocess_test::command_for_fn!((), |()| { use std::io::Write as _; // Signal readiness via stdout std::io::stdout().write_all(b"ready\n").unwrap(); diff --git a/crates/fspy/tests/spawn.rs b/crates/fspy/tests/spawn.rs index 0151fe990..6223b4a70 100644 --- a/crates/fspy/tests/spawn.rs +++ b/crates/fspy/tests/spawn.rs @@ -4,7 +4,7 @@ use tokio_util::sync::CancellationToken; #[test_log::test(tokio::test)] async fn invalid_working_directory_is_spawn_error() -> anyhow::Result<()> { let dir = tempfile::tempdir()?; - let command = subprocess_test::command_for_fn!((), |()| {}); + let command = vt_subprocess_test::command_for_fn!((), |()| {}); let mut command = fspy::Command::from(command); command.current_dir(dir.path().join("missing")); let result = command.spawn(CancellationToken::new()).await; diff --git a/crates/fspy/tests/test_utils/mod.rs b/crates/fspy/tests/test_utils/mod.rs index 9487b0d90..13d915430 100644 --- a/crates/fspy/tests/test_utils/mod.rs +++ b/crates/fspy/tests/test_utils/mod.rs @@ -15,7 +15,7 @@ use fspy::{AccessMode, PathAccessIterable}; unused_imports, reason = "used by track_child! macro; not all test files use this macro" )] -pub use subprocess_test::command_for_fn; +pub use vt_subprocess_test::command_for_fn; /// # Panics /// @@ -77,7 +77,7 @@ macro_rules! track_fn { reason = "allow attribute required for conditionally-used helper" )] #[allow(dead_code, reason = "used by track_fn! macro; not all test files use this macro")] -pub async fn spawn_command(cmd: subprocess_test::Command) -> anyhow::Result { +pub async fn spawn_command(cmd: vt_subprocess_test::Command) -> anyhow::Result { let termination = fspy::Command::from(cmd) .spawn(tokio_util::sync::CancellationToken::new()) .await? diff --git a/crates/fspy_shared/Cargo.toml b/crates/fspy_shared/Cargo.toml index d304f79fa..97f75416d 100644 --- a/crates/fspy_shared/Cargo.toml +++ b/crates/fspy_shared/Cargo.toml @@ -29,7 +29,7 @@ winapi = { workspace = true, features = ["std"] } assert2 = { workspace = true } ctor = { workspace = true } rustc-hash = { workspace = true } -subprocess_test = { workspace = true } +vt_subprocess_test = { workspace = true } tokio = { workspace = true, features = ["macros", "net", "rt-multi-thread", "time"] } [lints] diff --git a/crates/fspy_shared/src/ipc/channel/mod.rs b/crates/fspy_shared/src/ipc/channel/mod.rs index 19d0587df..5ea29c386 100644 --- a/crates/fspy_shared/src/ipc/channel/mod.rs +++ b/crates/fspy_shared/src/ipc/channel/mod.rs @@ -373,7 +373,7 @@ mod tests { use allocator_api2::alloc::Global; use assert2::assert; use bstr::B; - use subprocess_test::command_for_fn; + use vt_subprocess_test::command_for_fn; use super::*; use crate::ipc::{AccessMode, IpcPath, PathAccess}; diff --git a/crates/fspy_shared/src/ipc/channel/shm_io/mod.rs b/crates/fspy_shared/src/ipc/channel/shm_io/mod.rs index 8a592b187..9bc6586a5 100644 --- a/crates/fspy_shared/src/ipc/channel/shm_io/mod.rs +++ b/crates/fspy_shared/src/ipc/channel/shm_io/mod.rs @@ -556,7 +556,7 @@ mod tests { use std::process::{Child, Command}; use rustc_hash::FxHashSet; - use subprocess_test::command_for_fn; + use vt_subprocess_test::command_for_fn; const CHILD_COUNT: usize = 12; const FRAME_COUNT_EACH_CHILD: usize = 100; @@ -632,7 +632,7 @@ mod tests { process::{Command, Stdio}, }; - use subprocess_test::command_for_fn; + use vt_subprocess_test::command_for_fn; const SHM_SIZE: usize = 1024 * 1024; diff --git a/crates/fspy_shm/Cargo.toml b/crates/fspy_shm/Cargo.toml index 9b6da1115..416f5a6c9 100644 --- a/crates/fspy_shm/Cargo.toml +++ b/crates/fspy_shm/Cargo.toml @@ -20,7 +20,7 @@ windows-sys = { workspace = true, features = [ [dev-dependencies] ctor = { workspace = true } -subprocess_test = { workspace = true } +vt_subprocess_test = { workspace = true } tempfile = { workspace = true } [lints] diff --git a/crates/fspy_shm/src/lib.rs b/crates/fspy_shm/src/lib.rs index 05a245e7a..5070a6fed 100644 --- a/crates/fspy_shm/src/lib.rs +++ b/crates/fspy_shm/src/lib.rs @@ -30,7 +30,7 @@ mod tests { use std::{ffi::OsStr, mem::align_of, path::PathBuf, process::Command}; use fspy_nostd::{OsCStr, Thin}; - use subprocess_test::command_for_fn; + use vt_subprocess_test::command_for_fn; use super::{Mapping, create, open, remove}; diff --git a/crates/vt/Cargo.toml b/crates/vt/Cargo.toml index 7b6aed2b8..323d83e9f 100644 --- a/crates/vt/Cargo.toml +++ b/crates/vt/Cargo.toml @@ -24,7 +24,7 @@ futures-util = { workspace = true } once_cell = { workspace = true } owo-colors = { workspace = true, features = ["supports-colors"] } petgraph = { workspace = true } -pty_terminal_test_client = { workspace = true } +vt_pty_terminal_test_client = { workspace = true } rayon = { workspace = true } rusqlite = { workspace = true, features = ["bundled"] } rustc-hash = { workspace = true } @@ -44,7 +44,7 @@ tokio = { workspace = true, features = [ tokio-util = { workspace = true, features = ["rt"] } tracing = { workspace = true } twox-hash = { workspace = true } -materialized_artifact = { workspace = true } +vt_materialized_artifact = { workspace = true } uuid = { workspace = true, features = ["v4"] } vt_casefold = { workspace = true } vt_glob = { workspace = true } diff --git a/crates/vt/src/napi_client.rs b/crates/vt/src/napi_client.rs index 0f300911b..c74ac8bed 100644 --- a/crates/vt/src/napi_client.rs +++ b/crates/vt/src/napi_client.rs @@ -3,7 +3,7 @@ use std::{env, fs, sync::LazyLock}; -use materialized_artifact::artifact; +use vt_materialized_artifact::artifact; use vt_path::{AbsolutePath, AbsolutePathBuf}; /// Path to the materialized `vt_client_napi` `.node` addon. diff --git a/crates/vt/src/session/execute/scheduler.rs b/crates/vt/src/session/execute/scheduler.rs index 391d9f608..fb605a4a4 100644 --- a/crates/vt/src/session/execute/scheduler.rs +++ b/crates/vt/src/session/execute/scheduler.rs @@ -297,7 +297,7 @@ impl Session<'_> { if !hide_pending_uploads { reporter.uploads_pending(pending); } - pty_terminal_test_client::mark_milestone("uploads-pending"); + vt_pty_terminal_test_client::mark_milestone("uploads-pending"); } cache.wait_for_uploads(&interrupt_token).await; diff --git a/crates/vt/src/session/mod.rs b/crates/vt/src/session/mod.rs index a0f326747..5d449279b 100644 --- a/crates/vt/src/session/mod.rs +++ b/crates/vt/src/session/mod.rs @@ -544,7 +544,7 @@ impl<'a> Session<'a> { let select_result = vt_select::select_list(&mut stdout, ¶ms, mode, |state| { let milestone_name = vt_str::format!("task-select:{}:{}", state.query, state.selected_index); - pty_terminal_test_client::mark_milestone(&milestone_name); + vt_pty_terminal_test_client::mark_milestone(&milestone_name); })?; if matches!(select_result, vt_select::SelectResult::Cancelled) { diff --git a/crates/vt_bin/Cargo.toml b/crates/vt_bin/Cargo.toml index d17c14984..1b4e4e0fc 100644 --- a/crates/vt_bin/Cargo.toml +++ b/crates/vt_bin/Cargo.toml @@ -20,7 +20,7 @@ anyhow = { workspace = true } ctrlc = { workspace = true } libc = { workspace = true } notify = { workspace = true } -pty_terminal_test_client = { workspace = true } +vt_pty_terminal_test_client = { workspace = true } async-trait = { workspace = true } clap = { workspace = true, features = ["derive"] } jsonc-parser = { workspace = true, features = ["serde"] } @@ -39,10 +39,10 @@ cargo-platform = { workspace = true } cow-utils = { workspace = true } cp_r = { workspace = true } libtest-mimic = { workspace = true } -snapshot_test = { workspace = true } -pty_terminal = { workspace = true } -pty_terminal_test = { workspace = true } -pty_terminal_test_client = { workspace = true, features = ["testing"] } +vt_snapshot_test = { workspace = true } +vt_pty_terminal = { workspace = true } +vt_pty_terminal_test = { workspace = true } +vt_pty_terminal_test_client = { workspace = true, features = ["testing"] } regex = { workspace = true } serde = { workspace = true, features = ["derive", "rc"] } shell-escape = { workspace = true } @@ -54,11 +54,11 @@ vt_workspace = { workspace = true } [target.'cfg(target_os = "linux")'.dev-dependencies] # Artifact dep: the cdylib is built and its path is exposed to the e2e -# test harness via `CARGO_CDYLIB_FILE_PRELOAD_TEST_LIB` at test-runtime. -preload_test_lib = { path = "../preload_test_lib", artifact = "cdylib" } +# test harness via `CARGO_CDYLIB_FILE_VT_PRELOAD_TEST_LIB` at test-runtime. +vt_preload_test_lib = { path = "../vt_preload_test_lib", artifact = "cdylib" } [package.metadata.cargo-shear] -ignored = ["preload_test_lib"] +ignored = ["vt_preload_test_lib"] [lints] workspace = true diff --git a/crates/vt_bin/src/vtt/exit_on_ctrlc.rs b/crates/vt_bin/src/vtt/exit_on_ctrlc.rs index 3e13f8f65..81c3afdc2 100644 --- a/crates/vt_bin/src/vtt/exit_on_ctrlc.rs +++ b/crates/vt_bin/src/vtt/exit_on_ctrlc.rs @@ -36,7 +36,7 @@ pub fn run() -> Result<(), Box> { } })?; - pty_terminal_test_client::mark_milestone("ready"); + vt_pty_terminal_test_client::mark_milestone("ready"); ctrlc_once_lock.wait(); println!("ctrl-c received"); diff --git a/crates/vt_bin/src/vtt/stalled_remote_cache.rs b/crates/vt_bin/src/vtt/stalled_remote_cache.rs index eb468fa30..51376f6ed 100644 --- a/crates/vt_bin/src/vtt/stalled_remote_cache.rs +++ b/crates/vt_bin/src/vtt/stalled_remote_cache.rs @@ -83,7 +83,7 @@ impl Proxy { .strip_prefix(self.base_path.as_str()) .is_some_and(|route| self.stalled_routes.iter().any(|stalled| stalled == route)) { - pty_terminal_test_client::mark_milestone("stalled"); + vt_pty_terminal_test_client::mark_milestone("stalled"); let mut buf = [0; 4096]; while client.read(&mut buf).is_ok_and(|n| n > 0) {} return; diff --git a/crates/vt_bin/tests/e2e_snapshots/fixtures/preexisting_ld_preload/snapshots.toml b/crates/vt_bin/tests/e2e_snapshots/fixtures/preexisting_ld_preload/snapshots.toml index 28f177cec..6d6fa4cbd 100644 --- a/crates/vt_bin/tests/e2e_snapshots/fixtures/preexisting_ld_preload/snapshots.toml +++ b/crates/vt_bin/tests/e2e_snapshots/fixtures/preexisting_ld_preload/snapshots.toml @@ -8,7 +8,7 @@ cfg = 'all(target_os = "linux", target_env = "gnu")' comment = """ Reproduces #340 and verifies that fspy tolerates a user-supplied `LD_PRELOAD` by appending its shim instead of rejecting the spawn. Appending (not prepending) also preserves symbol-interposition order: the user's preload runs first, so short-circuited calls remain invisible to fspy — what the OS actually executed is what fspy records. -`preload_test_lib` (built as a cdylib artifact dep) intercepts `open`/`openat` and short-circuits any path containing the marker `preload_test_short_circuit`, returning `ENOENT` without forwarding. Every other path is forwarded via `RTLD_NEXT` so fspy still observes the real syscall. +`vt_preload_test_lib` (built as a cdylib artifact dep) intercepts `open`/`openat` and short-circuits any path containing the marker `preload_test_short_circuit`, returning `ENOENT` without forwarding. Every other path is forwarded via `RTLD_NEXT` so fspy still observes the real syscall. The `read` task prints two files. `real.txt` goes through the full interposer chain and is tracked as an input. `preload_test_short_circuit.txt` is short-circuited by the user preload; fspy never sees it and does not track it. Modifying the short-circuited file must therefore be a cache hit; modifying the real file must be a miss. """ diff --git a/crates/vt_bin/tests/e2e_snapshots/fixtures/preexisting_ld_preload/snapshots/preexisting_ld_preload.md b/crates/vt_bin/tests/e2e_snapshots/fixtures/preexisting_ld_preload/snapshots/preexisting_ld_preload.md index 031e814da..702482942 100644 --- a/crates/vt_bin/tests/e2e_snapshots/fixtures/preexisting_ld_preload/snapshots/preexisting_ld_preload.md +++ b/crates/vt_bin/tests/e2e_snapshots/fixtures/preexisting_ld_preload/snapshots/preexisting_ld_preload.md @@ -2,7 +2,7 @@ Reproduces #340 and verifies that fspy tolerates a user-supplied `LD_PRELOAD` by appending its shim instead of rejecting the spawn. Appending (not prepending) also preserves symbol-interposition order: the user's preload runs first, so short-circuited calls remain invisible to fspy — what the OS actually executed is what fspy records. -`preload_test_lib` (built as a cdylib artifact dep) intercepts `open`/`openat` and short-circuits any path containing the marker `preload_test_short_circuit`, returning `ENOENT` without forwarding. Every other path is forwarded via `RTLD_NEXT` so fspy still observes the real syscall. +`vt_preload_test_lib` (built as a cdylib artifact dep) intercepts `open`/`openat` and short-circuits any path containing the marker `preload_test_short_circuit`, returning `ENOENT` without forwarding. Every other path is forwarded via `RTLD_NEXT` so fspy still observes the real syscall. The `read` task prints two files. `real.txt` goes through the full interposer chain and is tracked as an input. `preload_test_short_circuit.txt` is short-circuited by the user preload; fspy never sees it and does not track it. Modifying the short-circuited file must therefore be a cache hit; modifying the real file must be a miss. diff --git a/crates/vt_bin/tests/e2e_snapshots/main.rs b/crates/vt_bin/tests/e2e_snapshots/main.rs index 33ecf9690..345c3ee7b 100644 --- a/crates/vt_bin/tests/e2e_snapshots/main.rs +++ b/crates/vt_bin/tests/e2e_snapshots/main.rs @@ -9,11 +9,11 @@ use std::{ }; use cp_r::CopyOptions; -use pty_terminal::{geo::ScreenSize, terminal::CommandBuilder}; -use pty_terminal_test::TestTerminal; use redact::redact_e2e_output; use vec1::Vec1; use vt_path::{AbsolutePath, AbsolutePathBuf, RelativePathBuf}; +use vt_pty_terminal::{geo::ScreenSize, terminal::CommandBuilder}; +use vt_pty_terminal_test::TestTerminal; use vt_str::Str; use vt_workspace::find_workspace_root; @@ -311,10 +311,10 @@ enum TerminationState { /// line, so snapshots stay machine-independent. fn resolve_env_placeholder(raw: &str) -> std::borrow::Cow<'_, OsStr> { if raw == "" { - let path = env::var_os("CARGO_CDYLIB_FILE_PRELOAD_TEST_LIB").unwrap_or_else(|| { + let path = env::var_os("CARGO_CDYLIB_FILE_VT_PRELOAD_TEST_LIB").unwrap_or_else(|| { panic!( - "CARGO_CDYLIB_FILE_PRELOAD_TEST_LIB not set; the e2e harness requires \ - the preload_test_lib cdylib artifact to be built by cargo" + "CARGO_CDYLIB_FILE_VT_PRELOAD_TEST_LIB not set; the e2e harness requires \ + the vt_preload_test_lib cdylib artifact to be built by cargo" ) }); std::borrow::Cow::Owned(path) @@ -324,7 +324,7 @@ fn resolve_env_placeholder(raw: &str) -> std::borrow::Cow<'_, OsStr> { } /// Render the byte stream produced by `screen_contents_formatted` (which uses -/// `vt100::Screen::rows_formatted` — see [`pty_terminal`]) into a +/// `vt100::Screen::rows_formatted` — see [`vt_pty_terminal`]) into a /// snapshot-friendly string. Newlines (added as row separators by the PTY /// helper) stay literal so the snapshot remains multi-line; SGR escapes and /// other bytes outside printable ASCII come out as `\xNN`, `\t`, etc. @@ -398,7 +398,7 @@ fn run_case( case_index: usize, e2e: &E2e, ) -> Result<(), String> { - let snapshots = snapshot_test::Snapshots::new(fixture_path.join("snapshots")); + let snapshots = vt_snapshot_test::Snapshots::new(fixture_path.join("snapshots")); // Copy the fixture to a per-case staging directory so the test runs in // isolation and workspace-root discovery doesn't walk past the fixture. diff --git a/crates/vt_client/Cargo.toml b/crates/vt_client/Cargo.toml index 900b9948e..798571d2e 100644 --- a/crates/vt_client/Cargo.toml +++ b/crates/vt_client/Cargo.toml @@ -8,7 +8,7 @@ rust-version.workspace = true [dependencies] rustc-hash = { workspace = true } -socket_ipc = { workspace = true } +vt_socket_ipc = { workspace = true } vt_casefold = { workspace = true } vt_path = { workspace = true } vt_ipc_shared = { workspace = true } diff --git a/crates/vt_client/src/lib.rs b/crates/vt_client/src/lib.rs index fc6d847e1..e95157d4c 100644 --- a/crates/vt_client/src/lib.rs +++ b/crates/vt_client/src/lib.rs @@ -6,13 +6,13 @@ use std::{ }; use rustc_hash::FxHashMap; -use socket_ipc::Client as Stream; use vt_casefold::EnvName; use vt_ipc_shared::{ EnvQuery as IpcEnvQuery, GetEnvResponse, GetEnvsResponse, IPC_ENV_NAME, Request, }; use vt_ipc_str::IpcStr; use vt_path::{self, AbsolutePath}; +use vt_socket_ipc::Client as Stream; use wincode::{SchemaRead, config::DefaultConfig}; pub struct Client { diff --git a/crates/materialized_artifact/.clippy.toml b/crates/vt_materialized_artifact/.clippy.toml similarity index 100% rename from crates/materialized_artifact/.clippy.toml rename to crates/vt_materialized_artifact/.clippy.toml diff --git a/crates/materialized_artifact/Cargo.toml b/crates/vt_materialized_artifact/Cargo.toml similarity index 72% rename from crates/materialized_artifact/Cargo.toml rename to crates/vt_materialized_artifact/Cargo.toml index 919370f18..c3e96482c 100644 --- a/crates/materialized_artifact/Cargo.toml +++ b/crates/vt_materialized_artifact/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "materialized_artifact" +name = "vt_materialized_artifact" version = "0.0.0" edition.workspace = true license.workspace = true @@ -7,7 +7,7 @@ publish = false rust-version.workspace = true [dependencies] -materialized_artifact_macros = { workspace = true } +vt_materialized_artifact_macros = { workspace = true } tempfile = { workspace = true } [lints] diff --git a/crates/materialized_artifact/README.md b/crates/vt_materialized_artifact/README.md similarity index 93% rename from crates/materialized_artifact/README.md rename to crates/vt_materialized_artifact/README.md index 60b505d35..aa966fb0b 100644 --- a/crates/materialized_artifact/README.md +++ b/crates/vt_materialized_artifact/README.md @@ -1,4 +1,4 @@ -# materialized_artifact +# vt_materialized_artifact Materialize a compile-time–embedded file to disk on demand, for APIs that need a filesystem path (`LoadLibrary`, `LD_PRELOAD`, helper binaries) rather diff --git a/crates/materialized_artifact/src/lib.rs b/crates/vt_materialized_artifact/src/lib.rs similarity index 98% rename from crates/materialized_artifact/src/lib.rs rename to crates/vt_materialized_artifact/src/lib.rs index 3bf00a075..175cd6b8b 100644 --- a/crates/materialized_artifact/src/lib.rs +++ b/crates/vt_materialized_artifact/src/lib.rs @@ -2,7 +2,7 @@ //! //! Some APIs need a file on disk — `LoadLibrary` and `LD_PRELOAD` take a //! path, and helper binaries have to exist as actual files to be spawned — -//! but we want to ship a single executable. `materialized_artifact` embeds +//! but we want to ship a single executable. `vt_materialized_artifact` embeds //! the file content as a `&'static [u8]` at compile time via the //! [`artifact!`] macro (same as `include_bytes!`), and [`Materialize::at`] //! writes it out to disk when first needed — that materialization step is @@ -43,7 +43,7 @@ pub struct Artifact { /// Construct an [`Artifact`] from an env var holding a file path at compile /// time — see the macro's own docs for usage and design notes. -pub use materialized_artifact_macros::artifact; +pub use vt_materialized_artifact_macros::artifact; impl Artifact { #[doc(hidden)] diff --git a/crates/materialized_artifact_macros/.clippy.toml b/crates/vt_materialized_artifact_macros/.clippy.toml similarity index 100% rename from crates/materialized_artifact_macros/.clippy.toml rename to crates/vt_materialized_artifact_macros/.clippy.toml diff --git a/crates/materialized_artifact_macros/Cargo.toml b/crates/vt_materialized_artifact_macros/Cargo.toml similarity index 89% rename from crates/materialized_artifact_macros/Cargo.toml rename to crates/vt_materialized_artifact_macros/Cargo.toml index c51d53948..f7c0effe4 100644 --- a/crates/materialized_artifact_macros/Cargo.toml +++ b/crates/vt_materialized_artifact_macros/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "materialized_artifact_macros" +name = "vt_materialized_artifact_macros" version = "0.0.0" edition.workspace = true license.workspace = true diff --git a/crates/materialized_artifact_macros/src/lib.rs b/crates/vt_materialized_artifact_macros/src/lib.rs similarity index 95% rename from crates/materialized_artifact_macros/src/lib.rs rename to crates/vt_materialized_artifact_macros/src/lib.rs index be4ca3ebe..0f7bef0a5 100644 --- a/crates/materialized_artifact_macros/src/lib.rs +++ b/crates/vt_materialized_artifact_macros/src/lib.rs @@ -1,4 +1,4 @@ -//! Proc-macro side of `materialized_artifact`: embed a file and its content +//! Proc-macro side of `vt_materialized_artifact`: embed a file and its content //! hash at compile time, given an env var holding the file's path. //! //! The env var is either a Cargo artifact dependency's `CARGO__FILE_` @@ -35,7 +35,7 @@ use syn::{ parse::{Parse, ParseStream}, }; -/// Construct a `materialized_artifact::Artifact` from an env var holding a +/// Construct a `vt_materialized_artifact::Artifact` from an env var holding a /// file path at compile time. /// /// Usage: `artifact!("fspy_preload", "CARGO_CDYLIB_FILE_FSPY_PRELOAD_UNIX")` @@ -108,7 +108,7 @@ fn expand(input: proc_macro::TokenStream) -> syn::Result { Ok(quote! { { #guard - ::materialized_artifact::Artifact::__new(#name, #content, #hash) + ::vt_materialized_artifact::Artifact::__new(#name, #content, #hash) } }) } diff --git a/crates/vt_plan/Cargo.toml b/crates/vt_plan/Cargo.toml index 1c23e81b3..1af0dfc92 100644 --- a/crates/vt_plan/Cargo.toml +++ b/crates/vt_plan/Cargo.toml @@ -39,7 +39,7 @@ clap = { workspace = true, features = ["derive"] } copy_dir = { workspace = true } libtest-mimic = { workspace = true } monostate = { workspace = true } -snapshot_test = { workspace = true } +vt_snapshot_test = { workspace = true } serde_json = { workspace = true } tempfile = { workspace = true } tokio = { workspace = true, features = ["rt", "macros"] } diff --git a/crates/vt_plan/tests/plan_snapshots/main.rs b/crates/vt_plan/tests/plan_snapshots/main.rs index 3e0315bff..433e86042 100644 --- a/crates/vt_plan/tests/plan_snapshots/main.rs +++ b/crates/vt_plan/tests/plan_snapshots/main.rs @@ -173,7 +173,7 @@ fn run_case( ) -> Result<(), String> { let fixture_name = fixture_path.file_name().unwrap().to_str().unwrap(); assert_identifier_like("fixture folder", fixture_name); - let snapshots = snapshot_test::Snapshots::new(fixture_path.join("snapshots")); + let snapshots = vt_snapshot_test::Snapshots::new(fixture_path.join("snapshots")); run_case_inner(runtime, tmpdir, fixture_path, fixture_name, &snapshots, cases_file) } @@ -187,7 +187,7 @@ fn run_case_inner( tmpdir: &AbsolutePath, fixture_path: &std::path::Path, fixture_name: &str, - snapshots: &snapshot_test::Snapshots, + snapshots: &vt_snapshot_test::Snapshots, cases_file: SnapshotsFile, ) -> Result<(), String> { // Copy the case directory to a temporary directory to avoid discovering workspace outside of the test case. diff --git a/crates/preload_test_lib/Cargo.toml b/crates/vt_preload_test_lib/Cargo.toml similarity index 89% rename from crates/preload_test_lib/Cargo.toml rename to crates/vt_preload_test_lib/Cargo.toml index 6a0d4fe56..0ffbafb93 100644 --- a/crates/preload_test_lib/Cargo.toml +++ b/crates/vt_preload_test_lib/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "preload_test_lib" +name = "vt_preload_test_lib" version = "0.0.0" edition.workspace = true license.workspace = true diff --git a/crates/preload_test_lib/src/lib.rs b/crates/vt_preload_test_lib/src/lib.rs similarity index 100% rename from crates/preload_test_lib/src/lib.rs rename to crates/vt_preload_test_lib/src/lib.rs diff --git a/crates/pty_terminal/.clippy.toml b/crates/vt_pty_terminal/.clippy.toml similarity index 100% rename from crates/pty_terminal/.clippy.toml rename to crates/vt_pty_terminal/.clippy.toml diff --git a/crates/pty_terminal/Cargo.toml b/crates/vt_pty_terminal/Cargo.toml similarity index 86% rename from crates/pty_terminal/Cargo.toml rename to crates/vt_pty_terminal/Cargo.toml index 9205346d3..8453b3d37 100644 --- a/crates/pty_terminal/Cargo.toml +++ b/crates/vt_pty_terminal/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "pty_terminal" +name = "vt_pty_terminal" version = "0.0.0" authors.workspace = true edition.workspace = true @@ -16,7 +16,7 @@ vt100 = { workspace = true } ctor = { workspace = true } ctrlc = { workspace = true } ntest = { workspace = true } -subprocess_test = { workspace = true, features = ["portable-pty"] } +vt_subprocess_test = { workspace = true, features = ["portable-pty"] } terminal_size = { workspace = true } [target.'cfg(unix)'.dev-dependencies] diff --git a/crates/pty_terminal/README.md b/crates/vt_pty_terminal/README.md similarity index 89% rename from crates/pty_terminal/README.md rename to crates/vt_pty_terminal/README.md index 442cf8dc2..49446fda5 100644 --- a/crates/pty_terminal/README.md +++ b/crates/vt_pty_terminal/README.md @@ -1,4 +1,4 @@ -# pty_terminal +# vt_pty_terminal A headless terminal emulator built on top of [portable-pty](https://crates.io/crates/portable-pty) and [vt100](https://crates.io/crates/vt100). It spawns child processes inside a pseudo-terminal (PTY) and provides an API for reading, writing, and resizing the terminal programmatically. @@ -13,7 +13,7 @@ A headless terminal emulator built on top of [portable-pty](https://crates.io/cr ## Usage ```rust -use pty_terminal::{geo::ScreenSize, terminal::{CommandBuilder, Terminal}}; +use vt_pty_terminal::{geo::ScreenSize, terminal::{CommandBuilder, Terminal}}; let cmd = CommandBuilder::new("echo"); cmd.arg("hello"); diff --git a/crates/pty_terminal/src/geo.rs b/crates/vt_pty_terminal/src/geo.rs similarity index 100% rename from crates/pty_terminal/src/geo.rs rename to crates/vt_pty_terminal/src/geo.rs diff --git a/crates/pty_terminal/src/lib.rs b/crates/vt_pty_terminal/src/lib.rs similarity index 100% rename from crates/pty_terminal/src/lib.rs rename to crates/vt_pty_terminal/src/lib.rs diff --git a/crates/pty_terminal/src/terminal.rs b/crates/vt_pty_terminal/src/terminal.rs similarity index 100% rename from crates/pty_terminal/src/terminal.rs rename to crates/vt_pty_terminal/src/terminal.rs diff --git a/crates/pty_terminal/tests/terminal.rs b/crates/vt_pty_terminal/tests/terminal.rs similarity index 99% rename from crates/pty_terminal/tests/terminal.rs rename to crates/vt_pty_terminal/tests/terminal.rs index 0d0b06e9a..d299b90c5 100644 --- a/crates/pty_terminal/tests/terminal.rs +++ b/crates/vt_pty_terminal/tests/terminal.rs @@ -5,8 +5,8 @@ use std::{ use ntest::timeout; use portable_pty::CommandBuilder; -use pty_terminal::{geo::ScreenSize, terminal::Terminal}; -use subprocess_test::command_for_fn; +use vt_pty_terminal::{geo::ScreenSize, terminal::Terminal}; +use vt_subprocess_test::command_for_fn; #[test] #[timeout(5000)] diff --git a/crates/pty_terminal_test/.clippy.toml b/crates/vt_pty_terminal_test/.clippy.toml similarity index 100% rename from crates/pty_terminal_test/.clippy.toml rename to crates/vt_pty_terminal_test/.clippy.toml diff --git a/crates/pty_terminal_test/Cargo.toml b/crates/vt_pty_terminal_test/Cargo.toml similarity index 63% rename from crates/pty_terminal_test/Cargo.toml rename to crates/vt_pty_terminal_test/Cargo.toml index e47ca1ffa..48fd4386d 100644 --- a/crates/pty_terminal_test/Cargo.toml +++ b/crates/vt_pty_terminal_test/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "pty_terminal_test" +name = "vt_pty_terminal_test" version = "0.0.0" authors.workspace = true edition.workspace = true @@ -10,15 +10,15 @@ rust-version.workspace = true [dependencies] anyhow = { workspace = true } portable-pty = { workspace = true } -pty_terminal = { workspace = true } -pty_terminal_test_client = { workspace = true } +vt_pty_terminal = { workspace = true } +vt_pty_terminal_test_client = { workspace = true } [dev-dependencies] crossterm = { workspace = true } ctor = { workspace = true } ntest = { workspace = true } -pty_terminal_test_client = { workspace = true, features = ["testing"] } -subprocess_test = { workspace = true, features = ["portable-pty"] } +vt_pty_terminal_test_client = { workspace = true, features = ["testing"] } +vt_subprocess_test = { workspace = true, features = ["portable-pty"] } [lints] workspace = true diff --git a/crates/pty_terminal_test/README.md b/crates/vt_pty_terminal_test/README.md similarity index 84% rename from crates/pty_terminal_test/README.md rename to crates/vt_pty_terminal_test/README.md index 27110c3b1..ef12ca326 100644 --- a/crates/pty_terminal_test/README.md +++ b/crates/vt_pty_terminal_test/README.md @@ -1,6 +1,6 @@ -# pty_terminal_test +# vt_pty_terminal_test -`pty_terminal_test` is a thin test helper on top of `pty_terminal` for writing +`vt_pty_terminal_test` is a thin test helper on top of `vt_pty_terminal` for writing integration tests against interactive CLI processes. It provides: @@ -16,15 +16,15 @@ You usually need explicit synchronization points from the child process. This crate solves that by pairing: -- `pty_terminal_test_client::mark_milestone("name")` in the child process, and +- `vt_pty_terminal_test_client::mark_milestone("name")` in the child process, and - `reader.expect_milestone("name")` in the test process. ## Core API ```rust use portable_pty::CommandBuilder; -use pty_terminal::geo::ScreenSize; -use pty_terminal_test::TestTerminal; +use vt_pty_terminal::geo::ScreenSize; +use vt_pty_terminal_test::TestTerminal; let cmd = CommandBuilder::from("your-binary-or-subprocess-test-command"); let TestTerminal { mut writer, mut reader, child_handle: _ } = @@ -70,9 +70,9 @@ The same token decoder and test API are used on every platform. In the child process: ```rust -pty_terminal_test_client::mark_milestone("ready"); +vt_pty_terminal_test_client::mark_milestone("ready"); // do work... -pty_terminal_test_client::mark_milestone("after-input"); +vt_pty_terminal_test_client::mark_milestone("after-input"); ``` In the parent test: diff --git a/crates/pty_terminal_test/src/lib.rs b/crates/vt_pty_terminal_test/src/lib.rs similarity index 93% rename from crates/pty_terminal_test/src/lib.rs rename to crates/vt_pty_terminal_test/src/lib.rs index c3b69d8cf..bf139c8f7 100644 --- a/crates/pty_terminal_test/src/lib.rs +++ b/crates/vt_pty_terminal_test/src/lib.rs @@ -1,8 +1,8 @@ use std::io::{BufReader, Read}; pub use portable_pty::CommandBuilder; -use pty_terminal::terminal::{PtyReader, Terminal}; -pub use pty_terminal::{ +use vt_pty_terminal::terminal::{PtyReader, Terminal}; +pub use vt_pty_terminal::{ ExitStatus, geo::ScreenSize, terminal::{ChildHandle, PtyWriter}, @@ -12,7 +12,7 @@ pub use pty_terminal::{ /// /// Wraps a PTY terminal, splitting it into a [`PtyWriter`] for sending input /// and a [`Reader`] that can wait for named milestones emitted by the child -/// process via [`pty_terminal_test_client::mark_milestone`]. +/// process via [`vt_pty_terminal_test_client::mark_milestone`]. pub struct TestTerminal { pub writer: PtyWriter, pub reader: Reader, @@ -71,7 +71,7 @@ impl Reader { loop { while let Some(title) = self.pty.get_ref().take_window_title() { - if pty_terminal_test_client::decode_milestone_title(&title) + if vt_pty_terminal_test_client::decode_milestone_title(&title) .is_some_and(|milestone| milestone == name) { return self.screen_contents(); diff --git a/crates/pty_terminal_test/tests/milestone.rs b/crates/vt_pty_terminal_test/tests/milestone.rs similarity index 90% rename from crates/pty_terminal_test/tests/milestone.rs rename to crates/vt_pty_terminal_test/tests/milestone.rs index 0b7bba03e..e64b97e28 100644 --- a/crates/pty_terminal_test/tests/milestone.rs +++ b/crates/vt_pty_terminal_test/tests/milestone.rs @@ -2,9 +2,9 @@ use std::io::Write; use ntest::timeout; use portable_pty::CommandBuilder; -use pty_terminal::geo::ScreenSize; -use pty_terminal_test::TestTerminal; -use subprocess_test::command_for_fn; +use vt_pty_terminal::geo::ScreenSize; +use vt_pty_terminal_test::TestTerminal; +use vt_subprocess_test::command_for_fn; #[test] #[timeout(5000)] @@ -16,7 +16,7 @@ fn milestone_raw_mode_keystrokes() { crossterm::terminal::enable_raw_mode().unwrap(); // Signal that raw mode is ready - pty_terminal_test_client::mark_milestone("ready"); + vt_pty_terminal_test_client::mark_milestone("ready"); let mut stdin = std::io::stdin(); let mut stdout = stdout(); @@ -30,7 +30,7 @@ fn milestone_raw_mode_keystrokes() { write!(stdout, "\x1b[2J\x1b[H{ch}").unwrap(); stdout.flush().unwrap(); - pty_terminal_test_client::mark_milestone("keystroke"); + vt_pty_terminal_test_client::mark_milestone("keystroke"); if ch == 'q' { break; @@ -81,7 +81,7 @@ fn milestone_does_not_pollute_screen() { use std::io::{Read, Write, stdout}; crossterm::terminal::enable_raw_mode().unwrap(); - pty_terminal_test_client::mark_milestone("ready"); + vt_pty_terminal_test_client::mark_milestone("ready"); let mut stdin = std::io::stdin(); let mut stdout = stdout(); @@ -95,7 +95,7 @@ fn milestone_does_not_pollute_screen() { write!(stdout, "{ch}").unwrap(); stdout.flush().unwrap(); - pty_terminal_test_client::mark_milestone("keystroke"); + vt_pty_terminal_test_client::mark_milestone("keystroke"); if ch == 'q' { break; @@ -131,7 +131,7 @@ fn milestone_does_not_pollute_screen() { #[expect(clippy::redundant_clone, reason = "command_for_fn evaluates its argument twice")] fn descendant_process_can_mark_milestone() { let nested = command_for_fn!((), |(): ()| { - pty_terminal_test_client::mark_milestone("nested"); + vt_pty_terminal_test_client::mark_milestone("nested"); }); let nested_program = nested.program.to_string_lossy().into_owned(); let nested_args = @@ -140,7 +140,7 @@ fn descendant_process_can_mark_milestone() { let cmd = CommandBuilder::from(command_for_fn!( (nested_program.clone(), nested_args.clone()), |(nested_program, nested_args): (String, Vec)| { - pty_terminal_test_client::mark_milestone("root"); + vt_pty_terminal_test_client::mark_milestone("root"); let status = std::process::Command::new(nested_program).args(nested_args).status().unwrap(); assert!(status.success()); diff --git a/crates/pty_terminal_test_client/.clippy.toml b/crates/vt_pty_terminal_test_client/.clippy.toml similarity index 100% rename from crates/pty_terminal_test_client/.clippy.toml rename to crates/vt_pty_terminal_test_client/.clippy.toml diff --git a/crates/pty_terminal_test_client/Cargo.toml b/crates/vt_pty_terminal_test_client/Cargo.toml similarity index 93% rename from crates/pty_terminal_test_client/Cargo.toml rename to crates/vt_pty_terminal_test_client/Cargo.toml index 8af6077af..cf39f0983 100644 --- a/crates/pty_terminal_test_client/Cargo.toml +++ b/crates/vt_pty_terminal_test_client/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "pty_terminal_test_client" +name = "vt_pty_terminal_test_client" version = "0.0.0" authors.workspace = true edition.workspace = true diff --git a/crates/pty_terminal_test_client/README.md b/crates/vt_pty_terminal_test_client/README.md similarity index 55% rename from crates/pty_terminal_test_client/README.md rename to crates/vt_pty_terminal_test_client/README.md index 8fb964a38..41f923d8d 100644 --- a/crates/pty_terminal_test_client/README.md +++ b/crates/vt_pty_terminal_test_client/README.md @@ -1,11 +1,11 @@ -# pty_terminal_test_client +# vt_pty_terminal_test_client -`pty_terminal_test_client` is the child-side helper used with -`pty_terminal_test`. +`vt_pty_terminal_test_client` is the child-side helper used with +`vt_pty_terminal_test`. It provides `mark_milestone("name")`, which emits milestone markers from the subprocess so the parent test can synchronize on them. Reader-side behavior and protocol details are documented in: -- `crates/pty_terminal_test/README.md` +- `crates/vt_pty_terminal_test/README.md` diff --git a/crates/pty_terminal_test_client/src/lib.rs b/crates/vt_pty_terminal_test_client/src/lib.rs similarity index 97% rename from crates/pty_terminal_test_client/src/lib.rs rename to crates/vt_pty_terminal_test_client/src/lib.rs index c6afd8f82..028818d41 100644 --- a/crates/pty_terminal_test_client/src/lib.rs +++ b/crates/vt_pty_terminal_test_client/src/lib.rs @@ -33,7 +33,7 @@ pub fn decode_milestone_title(title: &[u8]) -> Option { /// Emits a milestone marker as a unique window-title update. /// /// The child process calls this to signal it has reached a named synchronization -/// point. The test harness (via `pty_terminal_test::Reader::expect_milestone`) +/// point. The test harness (via `vt_pty_terminal_test::Reader::expect_milestone`) /// detects this marker and returns the screen contents at that point. /// /// Windows uses `SetConsoleTitleW`, which `ConPTY` emits through its renderer after diff --git a/crates/vt_server/Cargo.toml b/crates/vt_server/Cargo.toml index 9ea41f072..7494febed 100644 --- a/crates/vt_server/Cargo.toml +++ b/crates/vt_server/Cargo.toml @@ -13,7 +13,7 @@ thiserror = { workspace = true } tokio = { workspace = true, features = ["io-util", "rt", "macros"] } tokio-util = { workspace = true } tracing = { workspace = true } -socket_ipc = { workspace = true } +vt_socket_ipc = { workspace = true } vt_casefold = { workspace = true } vt_glob = { workspace = true } vt_path = { workspace = true } diff --git a/crates/vt_server/src/lib.rs b/crates/vt_server/src/lib.rs index 0a83c2a69..dd079d172 100644 --- a/crates/vt_server/src/lib.rs +++ b/crates/vt_server/src/lib.rs @@ -7,7 +7,6 @@ use std::{ use futures::{FutureExt, StreamExt, future::LocalBoxFuture, stream::FuturesUnordered}; use rustc_hash::{FxHashMap, FxHashSet}; -use socket_ipc::{Server as TransportServer, ServerConnection as Stream}; use tokio::io::{AsyncReadExt, AsyncWriteExt}; use tokio_util::sync::CancellationToken; use vt_casefold::EnvName; @@ -16,6 +15,7 @@ use vt_ipc_shared::{ }; use vt_ipc_str::IpcStr; use vt_path::AbsolutePath; +use vt_socket_ipc::{Server as TransportServer, ServerConnection as Stream}; use wincode::{SchemaWrite, config::DefaultConfig}; pub trait Handler { diff --git a/crates/vt_server/tests/integration.rs b/crates/vt_server/tests/integration.rs index 3986d0f5e..faef97069 100644 --- a/crates/vt_server/tests/integration.rs +++ b/crates/vt_server/tests/integration.rs @@ -6,13 +6,13 @@ use std::{ }; use rustc_hash::FxHashMap; -use socket_ipc::Client as RawStream; use tokio::runtime::Builder; use vt_casefold::EnvName; use vt_client::{Client, GetEnvsQuery}; use vt_ipc_shared::{EnvQuery as RawEnvQuery, GetEnvResponse, Request}; use vt_ipc_str::IpcStr; use vt_server::{EnvQuery, Error, Recorder, Reports, ServerHandle, serve}; +use vt_socket_ipc::Client as RawStream; fn env_map(pairs: &[(&str, &str)]) -> FxHashMap>, Arc> { pairs diff --git a/crates/snapshot_test/Cargo.toml b/crates/vt_snapshot_test/Cargo.toml similarity index 92% rename from crates/snapshot_test/Cargo.toml rename to crates/vt_snapshot_test/Cargo.toml index 329f9de45..ff1219640 100644 --- a/crates/snapshot_test/Cargo.toml +++ b/crates/vt_snapshot_test/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "snapshot_test" +name = "vt_snapshot_test" version = "0.1.0" authors.workspace = true edition.workspace = true diff --git a/crates/snapshot_test/README.md b/crates/vt_snapshot_test/README.md similarity index 98% rename from crates/snapshot_test/README.md rename to crates/vt_snapshot_test/README.md index 8dd9bf13c..cf0beefdb 100644 --- a/crates/snapshot_test/README.md +++ b/crates/vt_snapshot_test/README.md @@ -1,4 +1,4 @@ -# snapshot_test +# vt_snapshot_test Minimal snapshot testing primitive for this workspace. Two methods: diff --git a/crates/snapshot_test/src/lib.rs b/crates/vt_snapshot_test/src/lib.rs similarity index 100% rename from crates/snapshot_test/src/lib.rs rename to crates/vt_snapshot_test/src/lib.rs diff --git a/crates/socket_ipc/Cargo.toml b/crates/vt_socket_ipc/Cargo.toml similarity index 97% rename from crates/socket_ipc/Cargo.toml rename to crates/vt_socket_ipc/Cargo.toml index fa7231509..c34b5d53a 100644 --- a/crates/socket_ipc/Cargo.toml +++ b/crates/vt_socket_ipc/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "socket_ipc" +name = "vt_socket_ipc" version = "0.0.0" edition.workspace = true license.workspace = true diff --git a/crates/socket_ipc/README.md b/crates/vt_socket_ipc/README.md similarity index 97% rename from crates/socket_ipc/README.md rename to crates/vt_socket_ipc/README.md index b9ab847f5..79653ee07 100644 --- a/crates/socket_ipc/README.md +++ b/crates/vt_socket_ipc/README.md @@ -1,4 +1,4 @@ -# `socket_ipc` +# `vt_socket_ipc` Socket-style server-client IPC, implemented on named pipes rather than Unix domain sockets. diff --git a/crates/socket_ipc/src/lib.rs b/crates/vt_socket_ipc/src/lib.rs similarity index 97% rename from crates/socket_ipc/src/lib.rs rename to crates/vt_socket_ipc/src/lib.rs index 6b6e2cba7..bee5de201 100644 --- a/crates/socket_ipc/src/lib.rs +++ b/crates/vt_socket_ipc/src/lib.rs @@ -19,7 +19,7 @@ mod windows; use windows as imp; #[cfg(not(any(unix, windows)))] -compile_error!("socket_ipc supports only Unix and Windows"); +compile_error!("vt_socket_ipc supports only Unix and Windows"); /// A named server that asynchronously accepts byte-stream connections. pub struct Server { diff --git a/crates/socket_ipc/src/unix.rs b/crates/vt_socket_ipc/src/unix.rs similarity index 100% rename from crates/socket_ipc/src/unix.rs rename to crates/vt_socket_ipc/src/unix.rs diff --git a/crates/socket_ipc/src/windows.rs b/crates/vt_socket_ipc/src/windows.rs similarity index 100% rename from crates/socket_ipc/src/windows.rs rename to crates/vt_socket_ipc/src/windows.rs diff --git a/crates/socket_ipc/tests/integration.rs b/crates/vt_socket_ipc/tests/integration.rs similarity index 99% rename from crates/socket_ipc/tests/integration.rs rename to crates/vt_socket_ipc/tests/integration.rs index d7dc5598f..0070c9a22 100644 --- a/crates/socket_ipc/tests/integration.rs +++ b/crates/vt_socket_ipc/tests/integration.rs @@ -2,11 +2,11 @@ use std::io::{Read as _, Write as _}; #[cfg(unix)] use std::sync::mpsc; -use socket_ipc::{Client, Server}; use tokio::{ io::{AsyncReadExt as _, AsyncWriteExt as _}, runtime::Builder, }; +use vt_socket_ipc::{Client, Server}; #[test] fn round_trip() { diff --git a/crates/subprocess_test/.clippy.toml b/crates/vt_subprocess_test/.clippy.toml similarity index 100% rename from crates/subprocess_test/.clippy.toml rename to crates/vt_subprocess_test/.clippy.toml diff --git a/crates/subprocess_test/Cargo.toml b/crates/vt_subprocess_test/Cargo.toml similarity index 94% rename from crates/subprocess_test/Cargo.toml rename to crates/vt_subprocess_test/Cargo.toml index 720099a6a..dd3602f45 100644 --- a/crates/subprocess_test/Cargo.toml +++ b/crates/vt_subprocess_test/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "subprocess_test" +name = "vt_subprocess_test" version = "0.0.0" authors.workspace = true edition.workspace = true diff --git a/crates/subprocess_test/README.md b/crates/vt_subprocess_test/README.md similarity index 85% rename from crates/subprocess_test/README.md rename to crates/vt_subprocess_test/README.md index 95ff9b10b..782dd6d42 100644 --- a/crates/subprocess_test/README.md +++ b/crates/vt_subprocess_test/README.md @@ -1,4 +1,4 @@ -# subprocess_test +# vt_subprocess_test Provides the `command_for_fn!` macro for running functions in separate processes during tests. @@ -11,13 +11,13 @@ To use `command_for_fn!`, you need to add `ctor` as a dependency (usually dev-de ```toml [dev-dependencies] ctor = { workspace = true } -subprocess_test = { workspace = true } +vt_subprocess_test = { workspace = true } ``` Then use the macro in your tests: ```rust -use subprocess_test::command_for_fn; +use vt_subprocess_test::command_for_fn; let cmd = command_for_fn!(42u32, |arg: u32| { println!("{}", arg); diff --git a/crates/subprocess_test/src/lib.rs b/crates/vt_subprocess_test/src/lib.rs similarity index 98% rename from crates/subprocess_test/src/lib.rs rename to crates/vt_subprocess_test/src/lib.rs index f9f81b970..c3e105551 100644 --- a/crates/subprocess_test/src/lib.rs +++ b/crates/vt_subprocess_test/src/lib.rs @@ -48,7 +48,7 @@ impl From for portable_pty::CommandBuilder { } } -/// Creates a `subprocess_test::Command` that only executes the provided function. +/// Creates a `vt_subprocess_test::Command` that only executes the provided function. /// /// - $arg: The argument to pass to the function, must implement `SchemaWrite` and `SchemaReadOwned`. /// - $f: The function to run in the separate process, takes one argument of the type of $arg.