use openmoat_core::Verdict;
use openmoat_hosts::Host;
use openmoat_hosts::bench::Exit;
pub use openmoat_hosts::bench::{Answer, Place};
use super::Call;
use super::hook::Reply;
pub fn seen(host: Host, call: &Call, verdict: Verdict) -> Answer {
host.seen(call, verdict)
}
pub fn classify(host: Host, call: &Call, reply: &Reply) -> Answer {
let Reply::Exited {
code,
stdout,
stderr,
} = reply
else {
return Answer::Error;
};
host.read_reply(
call,
&Exit {
code: *code,
stdout,
stderr,
},
)
}
pub fn failure(host: Host) -> &'static str {
host.spec().on_hook_failure
}
pub fn payload(host: Host, call: &Call, at: &Place<'_>) -> Option<String> {
host.bench_payload(call, at)
}