diff --git a/kernel/src/kmain.rs b/kernel/src/kmain.rs index 625b9cd..1248ef5 100644 --- a/kernel/src/kmain.rs +++ b/kernel/src/kmain.rs @@ -23,11 +23,11 @@ pub fn kmain(_cmdline: &str, boot_modules: BootModules) -> ! { debug!("Entered kmain"); #[cfg(feature = "ktest")] { - use crate::ktest; - debug!("TESTING"); - ktest::test_main(); + use crate::ktest::test_main; + debug!("Running tests"); + test_main(); - loop {}; + loop {} } // let kcmd = build_cmd("Kernel Command Line", cmdline); diff --git a/kernel/src/ktest.rs b/kernel/src/ktest.rs index 11b983f..5c460a3 100644 --- a/kernel/src/ktest.rs +++ b/kernel/src/ktest.rs @@ -5,6 +5,8 @@ use { pub use ktest_macro::*; + +#[allow(improper_ctypes)] extern "C" { static __ktest_start: fn() -> Result; static __ktest_end: fn() -> Result; @@ -12,6 +14,7 @@ extern "C" { // TODO: Implement ktest for arm and riscv (Later problems, see below) // Allow for arch specific tests (Leave for now) +// Should panic tests pub fn test_main() { unsafe { let mut current_test = &__ktest_start as *const fn() -> Result; @@ -29,8 +32,8 @@ pub fn test_main() { debug!("Test: {} passed", name); pass += 1; }, - Err(ename) => { - debug!("Test: {} failed", ename); + Err(name) => { + debug!("Test: {} failed", name); fail += 1; } }