26 lines
778 B
Rust
26 lines
778 B
Rust
#![cfg(feature = "app")]
|
|
|
|
use std::process::Command;
|
|
|
|
#[test]
|
|
fn app_binary_starts_under_xvfb_without_panicking() {
|
|
if Command::new("xvfb-run").arg("--help").output().is_err() {
|
|
eprintln!("skipping app smoke test because xvfb-run is unavailable");
|
|
return;
|
|
}
|
|
|
|
let bin = env!("CARGO_BIN_EXE_openvistapro_app");
|
|
let output = Command::new("xvfb-run")
|
|
.args(["-a", "timeout", "8s", bin])
|
|
.output()
|
|
.expect("failed to launch xvfb-run for openvistapro_app");
|
|
|
|
assert_eq!(
|
|
output.status.code(),
|
|
Some(124),
|
|
"expected the app to start and then be interrupted by timeout; stdout={:?}; stderr={:?}",
|
|
String::from_utf8_lossy(&output.stdout),
|
|
String::from_utf8_lossy(&output.stderr)
|
|
);
|
|
}
|