plain-os/tests/basic_boot.rs

34 lines
856 B
Rust
Raw Permalink Normal View History

#![no_std]
#![no_main]
#![feature(custom_test_frameworks)]
#![test_runner(plain_os::test_runner)]
#![reexport_test_harness_main = "test_main"]
use core::panic::PanicInfo;
use plain_os::println;
#[no_mangle] // don't mangle the name of this function
pub extern "C" fn _start() -> ! {
test_main();
loop {}
}
#[panic_handler]
fn panic(info: &PanicInfo) -> ! {
plain_os::test_panic_handler(info)
}
#[test_case]
fn test_println() {
println!("test_println output");
}
// TODO(feliix42): Future Test Ideas
// - CPU Exceptions: validate that performing invalid operations (e.g., division by zero) leads to
// the correct exception handlers being called
// - Page Tables: validate/verify page table operations
// - Userspace Programs:Test userspace programs trying to perform illegal operations and see
// whether the kernel prevents them.
//