From ccf07c7bbd08ee33232b493672fdd7ba5f1db5f3 Mon Sep 17 00:00:00 2001 From: Natasha Moongrave Date: Tue, 17 Feb 2026 20:46:22 +0100 Subject: updated main.rs to use the current tests and println! working tree --- StrixKernel/src/main.rs | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/StrixKernel/src/main.rs b/StrixKernel/src/main.rs index f91134b..a037096 100644 --- a/StrixKernel/src/main.rs +++ b/StrixKernel/src/main.rs @@ -1,24 +1,39 @@ // main.rs -#![no_std] // don't link the Rust standard library -#![no_main] // disable all Rust-level entry points - -mod vga_buffer; +#![no_std] +#![no_main] +#![feature(custom_test_frameworks)] +#![test_runner(strix_os::test_runner)] +#![reexport_test_harness_main = "test_main"] +use strix_os::println; use core::panic::PanicInfo; -static HELLO: &[u8] = b"Hello World!"; - #[unsafe(no_mangle)] pub extern "C" fn _start() -> ! { println!("Hello World{}", "!"); - panic!("This is a test panic message"); + + #[cfg(test)] + test_main(); + loop {} } /// This function is called on panic. +#[cfg(not(test))] #[panic_handler] fn panic(info: &PanicInfo) -> ! { println!("{}", info); loop {} } + +#[cfg(test)] +#[panic_handler] +fn panic(info: &PanicInfo) -> ! { + strix_os::test_panic_handler(info) +} + +#[test_case] +fn trivial_assertion() { + assert_eq!(1, 1); +} \ No newline at end of file -- cgit v1.2.3