Writing an OS in Rust: Testing
We will use Rust’s support for custom test frameworks to execute test functions inside our kernel. To implement a custom test framework for our kernel, we add the following to our :
Our runner just prints a short debug message and then calls each test function in the list. The unsafe function expects the address of the first I/O port of the UART as argument, from which it can calculate the addresses of all needed ports.
Source: os.phil-opp.com