add interrupt tests (3h21m)

This commit is contained in:
Conzer 2024-12-03 18:57:44 -05:00
parent af973e8c8e
commit 2b2079d734
2 changed files with 7 additions and 0 deletions

View file

@ -18,3 +18,9 @@ extern "x86-interrupt" fn breakpoint_handler(
{ {
println!("EXCEPTION: BREAKPOINT\n{:#?}", stack_frame); println!("EXCEPTION: BREAKPOINT\n{:#?}", stack_frame);
} }
#[test_case]
fn test_breakpoint_exception() {
// invoke a breakpoint exception
x86_64::instructions::interrupts::int3();
}

View file

@ -50,6 +50,7 @@ pub fn test_panic_handler(info: &PanicInfo) -> ! {
#[cfg(test)] #[cfg(test)]
#[no_mangle] #[no_mangle]
pub extern "C" fn _start() -> ! { pub extern "C" fn _start() -> ! {
init();
test_main(); test_main();
loop {} loop {}
} }