Skip to content

Commit

Permalink
Added panic integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
jounathaen committed Feb 13, 2025
1 parent 7c04357 commit 2ba7eb3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/panic.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
mod common;

use common::{build_hermit_bin, run_simple_vm};

#[test]
fn panic_test() {
env_logger::try_init().ok();
let bin_path = build_hermit_bin("panic");
let res = run_simple_vm(bin_path);
println!("Kernel output: {:?}", res);
assert_eq!(res.code, -1);
}
7 changes: 7 additions & 0 deletions tests/test-kernels/src/bin/panic.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#[cfg(target_os = "hermit")]
use hermit as _;

fn main() {
println!("This test panics");
panic!("Aaaaaaaaargh!!!");
}

0 comments on commit 2ba7eb3

Please sign in to comment.