WIP integration test
This commit is contained in:
parent
7cac67b0fc
commit
a15d7d820f
16
src/lib.rs
Normal file
16
src/lib.rs
Normal file
@ -0,0 +1,16 @@
|
||||
#![no_std]
|
||||
#![cfg_attr(test, no_main)]
|
||||
#![feature(custom_test_frameworks)]
|
||||
#![test_runner(crate::test_utils::test_runner)]
|
||||
#![reexport_test_harness_main = "test_main"]
|
||||
|
||||
pub mod test_utils;
|
||||
pub mod serial;
|
||||
pub mod vga_buffer;
|
||||
|
||||
#[cfg(test)]
|
||||
#[no_mangle]
|
||||
pub extern "C" fn _start() {
|
||||
test_main();
|
||||
loop {}
|
||||
}
|
@ -20,8 +20,8 @@ fn panic(info: &core::panic::PanicInfo) -> ! {
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn _start() -> ! {
|
||||
#[cfg(test)]
|
||||
test_main();
|
||||
// #[cfg(test)]
|
||||
// test_main();
|
||||
|
||||
println!("Gamarjoba, munde!");
|
||||
loop {}
|
||||
|
@ -3,7 +3,7 @@
|
||||
use core::panic::PanicInfo;
|
||||
|
||||
#[panic_handler]
|
||||
fn panic(info: &PanicInfo) -> ! {
|
||||
pub fn panic(info: &PanicInfo) -> ! {
|
||||
serial_println!("[failed]\n");
|
||||
serial_println!("Error: {}", info);
|
||||
exit_qemu(QemuExitCode::Failed);
|
||||
|
23
tests/basic_boot.rs
Normal file
23
tests/basic_boot.rs
Normal file
@ -0,0 +1,23 @@
|
||||
#![no_std]
|
||||
#![no_main]
|
||||
#![feature(custom_test_frameworks)]
|
||||
#![test_runner(crate::test_utils::test_runner)]
|
||||
#![reexport_test_harness_main = "test_main"]
|
||||
|
||||
use core::panic::PanicInfo;
|
||||
|
||||
#[no_mangle] // don't mangle the name of this function
|
||||
pub extern "C" fn _start() -> ! {
|
||||
test_main();
|
||||
|
||||
loop {}
|
||||
}
|
||||
|
||||
fn test_runner(tests: &[&dyn Fn()]) {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
#[panic_handler]
|
||||
fn panic(info: &PanicInfo) -> ! {
|
||||
loop {}
|
||||
}
|
Loading…
Reference in New Issue
Block a user