Use entry_point! in all tests*
This commit is contained in:
parent
6da5f5c956
commit
e5efe96ffb
12
src/lib.rs
12
src/lib.rs
@ -65,9 +65,17 @@ pub fn hlt_loop() -> ! {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
#[no_mangle]
|
use bootloader::{entry_point, BootInfo};
|
||||||
pub extern "C" fn _start() -> ! {
|
|
||||||
|
#[cfg(test)]
|
||||||
|
entry_point!(test_kernel_main);
|
||||||
|
|
||||||
|
/// Entry point for `cargo xtest`
|
||||||
|
#[cfg(test)]
|
||||||
|
fn test_kernel_main(_boot_info: &'static BootInfo) -> ! {
|
||||||
|
init();
|
||||||
test_main();
|
test_main();
|
||||||
loop {}
|
loop {}
|
||||||
}
|
}
|
||||||
|
@ -8,8 +8,15 @@ use core::panic::PanicInfo;
|
|||||||
use polling_serial::{serial_print, serial_println};
|
use polling_serial::{serial_print, serial_println};
|
||||||
use vga_buffer::{print, println};
|
use vga_buffer::{print, println};
|
||||||
|
|
||||||
#[no_mangle] // don't mangle the name of this function
|
|
||||||
pub extern "C" fn _start() -> ! {
|
use bootloader::{entry_point, BootInfo};
|
||||||
|
|
||||||
|
entry_point!(test_kernel_main);
|
||||||
|
|
||||||
|
/// Entry point for `cargo xtest`
|
||||||
|
|
||||||
|
fn test_kernel_main(_boot_info: &'static BootInfo) -> ! {
|
||||||
|
dendrobates_tinctoreus_azureus::init();
|
||||||
test_main();
|
test_main();
|
||||||
|
|
||||||
loop {}
|
loop {}
|
||||||
|
@ -5,8 +5,14 @@ use core::panic::PanicInfo;
|
|||||||
use dendrobates_tinctoreus_azureus::{exit_qemu, QemuExitCode};
|
use dendrobates_tinctoreus_azureus::{exit_qemu, QemuExitCode};
|
||||||
use polling_serial::{serial_print, serial_println};
|
use polling_serial::{serial_print, serial_println};
|
||||||
|
|
||||||
#[no_mangle]
|
use bootloader::{entry_point, BootInfo};
|
||||||
pub extern "C" fn _start() -> ! {
|
|
||||||
|
entry_point!(test_kernel_main);
|
||||||
|
|
||||||
|
/// Entry point for `cargo xtest`
|
||||||
|
|
||||||
|
fn test_kernel_main(_boot_info: &'static BootInfo) -> ! {
|
||||||
|
dendrobates_tinctoreus_azureus::init();
|
||||||
should_fail();
|
should_fail();
|
||||||
serial_println!("[test did not panic]");
|
serial_println!("[test did not panic]");
|
||||||
exit_qemu(QemuExitCode::Failed);
|
exit_qemu(QemuExitCode::Failed);
|
||||||
|
@ -20,8 +20,14 @@ use vga_buffer::{print, println};
|
|||||||
use volatile::Volatile;
|
use volatile::Volatile;
|
||||||
use x86_64::structures::idt::{InterruptDescriptorTable, InterruptStackFrame};
|
use x86_64::structures::idt::{InterruptDescriptorTable, InterruptStackFrame};
|
||||||
|
|
||||||
#[no_mangle] // don't mangle the name of this function
|
use bootloader::{entry_point, BootInfo};
|
||||||
pub extern "C" fn _start() -> ! {
|
|
||||||
|
entry_point!(test_kernel_main);
|
||||||
|
|
||||||
|
/// Entry point for `cargo xtest`
|
||||||
|
|
||||||
|
fn test_kernel_main(_boot_info: &'static BootInfo) -> ! {
|
||||||
|
dendrobates_tinctoreus_azureus::init();
|
||||||
test_main();
|
test_main();
|
||||||
|
|
||||||
loop {}
|
loop {}
|
||||||
|
@ -9,8 +9,13 @@ use core::panic::PanicInfo;
|
|||||||
use dendrobates_tinctoreus_azureus::{exit_qemu, QemuExitCode};
|
use dendrobates_tinctoreus_azureus::{exit_qemu, QemuExitCode};
|
||||||
use polling_serial::{serial_print, serial_println};
|
use polling_serial::{serial_print, serial_println};
|
||||||
|
|
||||||
#[no_mangle]
|
use bootloader::{entry_point, BootInfo};
|
||||||
pub extern "C" fn _start() -> ! {
|
|
||||||
|
entry_point!(test_kernel_main);
|
||||||
|
|
||||||
|
/// Entry point for `cargo xtest`
|
||||||
|
|
||||||
|
fn test_kernel_main(_boot_info: &'static BootInfo) -> ! {
|
||||||
serial_print!("stack_overflow... ");
|
serial_print!("stack_overflow... ");
|
||||||
|
|
||||||
dendrobates_tinctoreus_azureus::gdt::init();
|
dendrobates_tinctoreus_azureus::gdt::init();
|
||||||
|
Loading…
Reference in New Issue
Block a user