mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-17 06:47:49 +00:00
Print test results over serial port
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
use core::panic::PanicInfo;
|
||||
|
||||
mod serial;
|
||||
mod vga_buffer;
|
||||
|
||||
#[no_mangle]
|
||||
@@ -20,7 +21,7 @@ pub extern "C" fn _start() -> ! {
|
||||
|
||||
#[cfg(test)]
|
||||
fn test_runner(tests: &[&dyn Fn()]) {
|
||||
println!("Running {} tests", tests.len());
|
||||
serial_println!("Running {} tests", tests.len());
|
||||
for test in tests {
|
||||
test();
|
||||
}
|
||||
@@ -50,7 +51,7 @@ pub unsafe fn exit_qemu(exit_code: QemuExitCode) {
|
||||
|
||||
#[test_case]
|
||||
fn trivial_assertion() {
|
||||
print!("trivial assertion... ");
|
||||
serial_print!("trivial assertion... ");
|
||||
assert_eq!(1, 1);
|
||||
println!("[ok]");
|
||||
serial_println!("[ok]");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user