#![allow(clippy::print_stdout, reason = "an example")]
use std::time::Duration;
const ROOT: &str = "/tmp/libtmux-rs-test";
fn main() {
match libtmux::test::reap_abandoned_servers(Duration::ZERO) {
Ok(reaped) if reaped.is_empty() => {
println!("nothing to reap: every fixture under {ROOT} has a living owner");
println!();
println!("A fixture cleans up after itself. One whose process was");
println!("killed -- SIGKILL, a crashed runner, a closed laptop lid --");
println!("cannot, and the tmux daemon it left keeps a pseudo-terminal");
println!("per pane. Run this after a test run that died and it lists");
println!("what it removed.");
}
Ok(reaped) => {
println!("reaped {} abandoned fixtures:", reaped.len());
for path in reaped {
println!(" {}", path.display());
}
}
Err(error) => eprintln!("could not read the temporary root: {error:?}"),
}
}