Implement code for integration test post

This commit is contained in:
Philipp Oppermann
2018-06-12 19:25:53 +02:00
parent 40eb19b613
commit 8b5be6ebc0
7 changed files with 125 additions and 12 deletions

27
src/bin/test-panic.rs Normal file
View File

@@ -0,0 +1,27 @@
#![feature(panic_implementation)]
#![feature(const_fn)]
#![no_std]
#![cfg_attr(not(test), no_main)]
#[macro_use]
extern crate blog_os;
#[cfg(not(test))]
use core::panic::PanicInfo;
use blog_os::exit_qemu;
#[cfg(not(test))]
#[no_mangle]
pub extern "C" fn _start() -> ! {
panic!();
}
#[cfg(not(test))]
#[panic_implementation]
#[no_mangle]
pub fn panic(_info: &PanicInfo) -> ! {
serial_println!("ok");
unsafe { exit_qemu(); }
loop {}
}