mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 22:37:49 +00:00
Add test-basic-boot and test-panic integration tests
This commit is contained in:
23
src/bin/test-panic.rs
Normal file
23
src/bin/test-panic.rs
Normal file
@@ -0,0 +1,23 @@
|
||||
#![cfg_attr(not(test), no_std)]
|
||||
#![cfg_attr(not(test), no_main)]
|
||||
#![cfg_attr(test, allow(unused_imports))]
|
||||
|
||||
use blog_os::{exit_qemu, serial_println};
|
||||
use core::panic::PanicInfo;
|
||||
|
||||
#[cfg(not(test))]
|
||||
#[no_mangle]
|
||||
pub extern "C" fn _start() -> ! {
|
||||
panic!();
|
||||
}
|
||||
|
||||
#[cfg(not(test))]
|
||||
#[panic_handler]
|
||||
fn panic(_info: &PanicInfo) -> ! {
|
||||
serial_println!("ok");
|
||||
|
||||
unsafe {
|
||||
exit_qemu();
|
||||
}
|
||||
loop {}
|
||||
}
|
||||
Reference in New Issue
Block a user