From 5366fe2ff8654f72e85eab593ad01e8e304372be Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Fri, 25 Jan 2019 13:24:54 +0100 Subject: [PATCH] Make `cargo test` work --- src/main.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 18e03650..739b1983 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,10 +1,11 @@ #![no_std] -#![no_main] +#![cfg_attr(not(test), no_main)] use core::panic::PanicInfo; mod vga_buffer; +#[cfg(not(test))] #[no_mangle] pub extern "C" fn _start() -> ! { println!("Hello World{}", "!"); @@ -13,6 +14,7 @@ pub extern "C" fn _start() -> ! { } /// This function is called on panic. +#[cfg(not(test))] #[panic_handler] fn panic(info: &PanicInfo) -> ! { println!("{}", info);