Files
cflmy ea41256671 test(tool): make the tool protocol suite cross-platform (B-14)
Replace the /bin/sh tool fixtures with a std-only fixture compiled by rustc,
and use platform EXE_SUFFIX for entrypoints. Windows/macOS workspace tests now
run the whole Tool protocol suite instead of skipping it. Keep C ABI/worker
and package/Git tests Unix-only and document that remaining gap.
2026-11-20 13:09:51 +08:00

31 lines
984 B
Rust

//! Portable external-tool fixture used by `crates/cli/tests/tool_protocol.rs`.
//!
//! It intentionally exercises only std: argument forwarding, protocol
//! environment variables and a non-zero exit code. Compile it with rustc; do
//! not add it to the workspace (this keeps the fixture usable on Windows and
//! macOS without shell assumptions).
use std::io::Read;
fn main() {
for argument in std::env::args().skip(1) {
println!("arg={argument}");
}
println!(
"protocol={}",
std::env::var("MARQDO_TOOL_PROTOCOL").unwrap_or_default()
);
if let Ok(value) = std::env::var("MARQDO_PROTOCOL_ANALYSIS") {
println!("analysis={value}");
}
if let Ok(value) = std::env::var("MARQDO_PROTOCOL_TRACE") {
println!("trace={value}");
}
let mut stdin = String::new();
let _ = std::io::stdin().read_to_string(&mut stdin);
if !stdin.is_empty() {
print!("stdin={stdin}");
}
std::process::exit(7);
}