diff --git a/src/arch/x86_64/mod.rs b/src/arch/x86_64/mod.rs index 30626bae..e8c356f0 100644 --- a/src/arch/x86_64/mod.rs +++ b/src/arch/x86_64/mod.rs @@ -320,6 +320,11 @@ mod tests { #[test] fn test_pagetable_initialization() { + let _ = env_logger::builder() + .filter(None, log::LevelFilter::Debug) + .is_test(true) + .try_init(); + let mut mem: Vec = vec![0; MIN_PHYSMEM_SIZE]; initialize_pagetables((&mut mem[0..MIN_PHYSMEM_SIZE]).try_into().unwrap()); @@ -369,6 +374,11 @@ mod tests { #[test] fn test_virt_to_phys() { + let _ = env_logger::builder() + .filter(None, log::LevelFilter::Trace) + .is_test(true) + .try_init(); + let mem = MmapMemory::new(0, MIN_PHYSMEM_SIZE * 2, GuestPhysAddr::new(0), true, true); initialize_pagetables(unsafe { mem.as_slice_mut() }.try_into().unwrap()); diff --git a/tests/common.rs b/tests/common.rs index a8c4cf64..bdd9f58f 100644 --- a/tests/common.rs +++ b/tests/common.rs @@ -11,8 +11,9 @@ use uhyvelib::{params::Params, vm::UhyveVm}; /// Returns a path to the build binary. pub fn build_hermit_bin(kernel: impl AsRef) -> PathBuf { let kernel = kernel.as_ref(); - println!("Building Kernel {}", kernel.display()); let kernel_src_path = Path::new("tests/test-kernels"); + println!("Building test kernel: {}", kernel.display()); + let cmd = Command::new("cargo") .arg("build") .arg("-Zbuild-std=std,panic_abort") @@ -26,7 +27,8 @@ pub fn build_hermit_bin(kernel: impl AsRef) -> PathBuf { .current_dir(kernel_src_path) .status() .expect("failed to execute `cargo build`"); - assert!(cmd.success(), "Test binaries could not be build"); + + assert!(cmd.success(), "Test binaries could not be built."); [ kernel_src_path, Path::new("target/x86_64-unknown-hermit/debug"), @@ -39,6 +41,7 @@ pub fn build_hermit_bin(kernel: impl AsRef) -> PathBuf { /// Small wrapper around [`Uhyve::run`] with default parameters for a small and /// simple Uhyve vm pub fn run_simple_vm(kernel_path: PathBuf) { + println!("Launching kernel {}", kernel_path.display()); let params = Params { verbose: true, cpu_count: 2.try_into().unwrap(), diff --git a/tests/gdb.rs b/tests/gdb.rs index b3593f6d..a2dbd33f 100644 --- a/tests/gdb.rs +++ b/tests/gdb.rs @@ -47,6 +47,7 @@ symbol-file {bin_path} -o 0x400000 break gdb::main continue +next next next pipe print _x|cat >> {output_path} diff --git a/tests/test-kernels/src/bin/create_file.rs b/tests/test-kernels/src/bin/create_file.rs index eff52a1f..943d5b14 100644 --- a/tests/test-kernels/src/bin/create_file.rs +++ b/tests/test-kernels/src/bin/create_file.rs @@ -4,6 +4,8 @@ use std::{fs::File, io::prelude::*}; use hermit as _; fn main() { + println!("Hello from create_file!"); + let mut file = File::create("/root/foo.txt").unwrap(); file.write_all(b"Hello, world!").unwrap(); } diff --git a/tests/test-kernels/src/bin/gdb.rs b/tests/test-kernels/src/bin/gdb.rs index 526d0e01..251946e3 100644 --- a/tests/test-kernels/src/bin/gdb.rs +++ b/tests/test-kernels/src/bin/gdb.rs @@ -4,6 +4,8 @@ use hermit as _; static mut WATCH: u8 = 2; fn main() { + println!("Hello from gdb!"); + let _x = 5; opaque(_x); let _x = 3.5; diff --git a/tests/test-kernels/src/bin/serial.rs b/tests/test-kernels/src/bin/serial.rs index dd1af2af..c8fb8e03 100644 --- a/tests/test-kernels/src/bin/serial.rs +++ b/tests/test-kernels/src/bin/serial.rs @@ -27,7 +27,7 @@ pub fn virtual_to_physical(virtual_address: VirtAddr) -> Option { } fn main() { - println!("Test"); + println!("Hello from serial!"); let mut serial_byte_port = Port::new(HypercallAddress::Uart as u16); for c in "ABCD\n".bytes() {