From 26a7561196674b39f9adadcb374f36c503361adb Mon Sep 17 00:00:00 2001 From: Dennis Kobert Date: Sat, 9 Nov 2019 15:11:50 +0100 Subject: Add basic tests --- kernel/tests/int3.rs | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 kernel/tests/int3.rs (limited to 'kernel/tests/int3.rs') diff --git a/kernel/tests/int3.rs b/kernel/tests/int3.rs new file mode 100644 index 0000000..771c17d --- /dev/null +++ b/kernel/tests/int3.rs @@ -0,0 +1,32 @@ +#![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::io::qemu; + +#[no_mangle] +extern "C" fn _start() -> ! { + kernel::init(); + test_main(); + + loop {} +} + +#[test_case] +fn breakpoint() { + x86_64::instructions::interrupts::int3(); +} + +#[cfg(test)] +#[panic_handler] +#[no_mangle] +extern "C" fn panic_handler(info: &core::panic::PanicInfo) -> ! { + kernel::testing::serial_should_panic(info); + loop {} +} -- cgit v1.2.3-70-g09d2