Skip to content

Commit f5082f7

Browse files
committed
debug test failure
Signed-off-by: Simon Davies <[email protected]>
1 parent 164961f commit f5082f7

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

src/hyperlight_host/src/mem/shared_mem.rs

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,21 +1247,26 @@ mod tests {
12471247
} else {
12481248
vec![]
12491249
};
1250-
let status = std::process::Command::new("cargo")
1250+
let output = std::process::Command::new("cargo")
12511251
.args(["test", "-p", "hyperlight-host"])
12521252
.args(target_args)
12531253
.args(["--", "--ignored", test])
12541254
.stdin(std::process::Stdio::null())
1255-
.stdout(std::process::Stdio::null())
1256-
.stderr(std::process::Stdio::null())
1257-
.status()
1255+
.output()
12581256
.expect("Unable to launch tests");
1259-
assert_eq!(
1260-
status.code(),
1261-
Some(TEST_EXIT_CODE.into()),
1262-
"Guard Page test failed: {}",
1263-
test
1264-
);
1257+
let exit_code = output.status.code();
1258+
if exit_code != Some(TEST_EXIT_CODE.into()) {
1259+
eprintln!("=== Guard Page test '{}' failed ===", test);
1260+
eprintln!("Exit code: {:?} (expected {})", exit_code, TEST_EXIT_CODE);
1261+
eprintln!("=== STDOUT ===");
1262+
eprintln!("{}", String::from_utf8_lossy(&output.stdout));
1263+
eprintln!("=== STDERR ===");
1264+
eprintln!("{}", String::from_utf8_lossy(&output.stderr));
1265+
panic!(
1266+
"Guard Page test failed: {} (exit code {:?}, expected {})",
1267+
test, exit_code, TEST_EXIT_CODE
1268+
);
1269+
}
12651270
}
12661271
}
12671272
}

0 commit comments

Comments
 (0)