dendrobates-t-azureus/tests/panic_test.rs
GuillaumeDIDIER fb926dfe2a Refactor to start integrating frequency measurement and portability
- added preliminary tests of frequency measurements
- refactored the signature of calibrate function to parametrize hash function
- various cleanup
2020-05-11 17:04:33 +02:00

31 lines
687 B
Rust

#![no_std]
#![no_main]
use core::panic::PanicInfo;
use dendrobates_tinctoreus_azureus::{exit_qemu, QemuExitCode};
use polling_serial::{serial_print, serial_println};
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();
should_fail();
serial_println!("[test did not panic]");
exit_qemu(QemuExitCode::Failed);
}
fn should_fail() {
serial_print!("should_fail... ");
assert_eq!(0, 1);
}
#[panic_handler]
fn panic(_info: &PanicInfo) -> ! {
serial_println!("[ok]");
exit_qemu(QemuExitCode::Success);
}