#![cfg(not(hyperlight))]
#[test]
fn tracing_does_not_have_release_max_level_error() {
let mut cmd = std::process::Command::new(env!("CARGO"));
let output = cmd
.arg("tree")
.arg("-p")
.arg("hyperlight-js-runtime")
.arg("-f")
.arg("{f}")
.arg("-i")
.arg("tracing")
.arg("--depth")
.arg("0")
.env("RUSTFLAGS", "--cfg=hyperlight --check-cfg=cfg(hyperlight)")
.output()
.expect("Failed to run cargo hyperlight tree");
assert!(
output.status.success(),
"cargo hyperlight tree failed: {}",
String::from_utf8_lossy(&output.stderr)
);
let stdout = String::from_utf8_lossy(&output.stdout);
let features: Vec<&str> = stdout.trim().split(',').collect();
assert!(
!features.contains(&"release_max_level_error"),
"tracing crate should NOT have 'release_max_level_error' feature enabled.\n\
Enabled features: {stdout}\n\
See: https://github.com/hyperlight-dev/hyperlight-js/issues/126"
);
assert!(
features.contains(&"max_level_trace"),
"tracing crate should have 'max_level_trace' feature enabled.\n\
Enabled features: {stdout}"
);
}