Make cargo test work

This commit is contained in:
Philipp Oppermann
2019-01-25 13:24:54 +01:00
parent 6c427e7cee
commit 5366fe2ff8

View File

@@ -1,10 +1,11 @@
#![no_std] #![no_std]
#![no_main] #![cfg_attr(not(test), no_main)]
use core::panic::PanicInfo; use core::panic::PanicInfo;
mod vga_buffer; mod vga_buffer;
#[cfg(not(test))]
#[no_mangle] #[no_mangle]
pub extern "C" fn _start() -> ! { pub extern "C" fn _start() -> ! {
println!("Hello World{}", "!"); println!("Hello World{}", "!");
@@ -13,6 +14,7 @@ pub extern "C" fn _start() -> ! {
} }
/// This function is called on panic. /// This function is called on panic.
#[cfg(not(test))]
#[panic_handler] #[panic_handler]
fn panic(info: &PanicInfo) -> ! { fn panic(info: &PanicInfo) -> ! {
println!("{}", info); println!("{}", info);