summaryrefslogtreecommitdiff
path: root/kernel/tests/int3.rs
diff options
context:
space:
mode:
authorDennis Kobert <dennis@kobert.dev>2019-11-11 18:42:59 +0100
committerDennis Kobert <dennis@kobert.dev>2019-11-11 18:42:59 +0100
commitec22f3464c87b3d1b1688898053a569bc4839404 (patch)
tree7332136eb3c3cb08dea32cbd89ee3254b55466bb /kernel/tests/int3.rs
parent26a7561196674b39f9adadcb374f36c503361adb (diff)
Add expect fault handling
Diffstat (limited to 'kernel/tests/int3.rs')
-rw-r--r--kernel/tests/int3.rs16
1 files changed, 7 insertions, 9 deletions
diff --git a/kernel/tests/int3.rs b/kernel/tests/int3.rs
index 771c17d..f4e2116 100644
--- a/kernel/tests/int3.rs
+++ b/kernel/tests/int3.rs
@@ -1,28 +1,26 @@
#![no_main]
#![feature(compiler_builtins_lib)]
-#![feature(custom_test_frameworks)]
#![feature(abi_x86_interrupt)]
#![feature(panic_info_message)]
-#![test_runner(kernel::testing::serial_test_runner)]
-#![reexport_test_harness_main = "test_main"]
#![no_std]
use kernel;
+use kernel::interrupts;
+use kernel::interrupts::exceptions;
use kernel::io::qemu;
#[no_mangle]
extern "C" fn _start() -> ! {
kernel::init();
- test_main();
+ unsafe {
+ exceptions::expect_fault(interrupts::Interrupts::BREAKPOINT);
+ }
+ x86_64::instructions::interrupts::int3();
+ panic!("BREAKPOINT not caught");
loop {}
}
-#[test_case]
-fn breakpoint() {
- x86_64::instructions::interrupts::int3();
-}
-
#[cfg(test)]
#[panic_handler]
#[no_mangle]