From 2b2079d734ad1f32a9e791f0a7d663f94ac181f1 Mon Sep 17 00:00:00 2001 From: Conzer Date: Tue, 3 Dec 2024 18:57:44 -0500 Subject: [PATCH] add interrupt tests (3h21m) --- src/interrupts.rs | 6 ++++++ src/lib.rs | 1 + 2 files changed, 7 insertions(+) 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 {} }