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

@ -17,4 +17,10 @@ extern "x86-interrupt" fn breakpoint_handler(
stack_frame: InterruptStackFrame)
{
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)]
#[no_mangle]
pub extern "C" fn _start() -> ! {
init();
test_main();
loop {}
}