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.
This commit is contained in:
1 parent
0f01a69048
commit
ea41256671
3 files changed
+96
-20
No files matched your search
Vendored
+30
@@ -0,0 +1,30 @@
|
||||
//! 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);
|
||||
}
|
||||
Reference in new issue
Block a user