use std::process::Command;
fn run(example: &str) {
let output = Command::new(env!("CARGO"))
.args(["run", "--quiet", "--release", "--example", example])
.output()
.unwrap_or_else(|e| panic!("could not launch `{example}`: {e}"));
assert!(
output.status.success(),
"example `{example}` failed ({}):\n{}\n{}",
output.status,
String::from_utf8_lossy(&output.stdout),
String::from_utf8_lossy(&output.stderr),
);
}
#[test]
fn game_example_runs() {
run("game");
}
#[test]
fn basic_example_runs() {
run("basic");
}
#[test]
fn isolation_example_runs() {
run("isolation");
}