use std::path::PathBuf;
fn workspace_root() -> PathBuf {
let manifest_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
manifest_dir
.parent()
.expect("sacp-test should be in src/")
.parent()
.expect("src/ should be in workspace root")
.to_path_buf()
}
pub fn debug_binary(name: &str) -> PathBuf {
workspace_root().join("target/debug").join(name)
}
pub fn debug_example(name: &str) -> PathBuf {
workspace_root().join("target/debug/examples").join(name)
}
pub fn require_binary(path: &PathBuf) {
if !path.exists() {
panic!(
"Binary not found at {:?}.\n\
Run `just prep-tests` before running these tests.",
path
);
}
}
pub fn conductor_binary() -> PathBuf {
let path = debug_binary("sacp-conductor");
require_binary(&path);
path
}
pub fn elizacp_binary() -> PathBuf {
let path = debug_binary("elizacp");
require_binary(&path);
path
}
pub fn elizacp() -> sacp_tokio::AcpAgent {
sacp_tokio::AcpAgent::from_args([
elizacp_binary().to_string_lossy().to_string(),
"--deterministic".to_string(),
"acp".to_string(),
])
.expect("failed to create elizacp agent")
}
pub fn mcp_echo_server_binary() -> PathBuf {
let path = debug_binary("mcp-echo-server");
require_binary(&path);
path
}
pub fn arrow_proxy_example() -> PathBuf {
let path = debug_example("arrow_proxy");
require_binary(&path);
path
}