diff --git a/src/interrupts.rs b/src/interrupts.rs index 1e3f168..d0440b1 100644 --- a/src/interrupts.rs +++ b/src/interrupts.rs @@ -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(); } \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs index a3bea39..297bb59 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -50,6 +50,7 @@ pub fn test_panic_handler(info: &PanicInfo) -> ! { #[cfg(test)] #[no_mangle] pub extern "C" fn _start() -> ! { + init(); test_main(); loop {} }