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.
31 lines
984 B
Rust
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);
|
|
}
|