Print test results over serial port

This commit is contained in:
Philipp Oppermann
2019-04-20 18:40:25 +02:00
parent 98a0e605be
commit 1559493802
4 changed files with 56 additions and 4 deletions

View File

@@ -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]");
}