From 7107977637366c55f42335a9ca1095d36b825a45 Mon Sep 17 00:00:00 2001 From: Anders Olsson Date: Mon, 25 May 2026 12:03:13 +0200 Subject: [PATCH] test(xy): helper binaries for integration tests --- crates/xy/Cargo.toml | 8 ++++++++ crates/xy/src/bin/xy_test_exit_failure.rs | 4 ++++ crates/xy/src/bin/xy_test_sleep_server.rs | 12 ++++++++++++ 3 files changed, 24 insertions(+) create mode 100644 crates/xy/src/bin/xy_test_exit_failure.rs create mode 100644 crates/xy/src/bin/xy_test_sleep_server.rs diff --git a/crates/xy/Cargo.toml b/crates/xy/Cargo.toml index bd6609b..f458b5e 100644 --- a/crates/xy/Cargo.toml +++ b/crates/xy/Cargo.toml @@ -8,6 +8,14 @@ license.workspace = true name = "xy" path = "src/main.rs" +[[bin]] +name = "xy-test-sleep-server" +path = "src/bin/xy_test_sleep_server.rs" + +[[bin]] +name = "xy-test-exit-failure" +path = "src/bin/xy_test_exit_failure.rs" + [dependencies] xy-protocol.workspace = true xy-supervisor.workspace = true diff --git a/crates/xy/src/bin/xy_test_exit_failure.rs b/crates/xy/src/bin/xy_test_exit_failure.rs new file mode 100644 index 0000000..3dd55d4 --- /dev/null +++ b/crates/xy/src/bin/xy_test_exit_failure.rs @@ -0,0 +1,4 @@ +fn main() { + eprintln!("exit_failure dying immediately"); + std::process::exit(7); +} diff --git a/crates/xy/src/bin/xy_test_sleep_server.rs b/crates/xy/src/bin/xy_test_sleep_server.rs new file mode 100644 index 0000000..e5110d9 --- /dev/null +++ b/crates/xy/src/bin/xy_test_sleep_server.rs @@ -0,0 +1,12 @@ +fn main() { + use std::io::Write; + let pid = std::process::id(); + eprintln!("sleep_server start pid={pid}"); + println!("ready"); + std::io::stdout().flush().ok(); + loop { + std::thread::sleep(std::time::Duration::from_secs(60)); + println!("tick"); + std::io::stdout().flush().ok(); + } +}