Writing an OS in Rust: Testing
Author here. This post is a rewrite of the previous Unit Testing [1] and Integration Tests [2] posts. It creates a custom test framework that runs test functions inside QEMU, so that they run in a realistic environment (compared to running on the host system).<p>[1]: <a href="https://os.phil-opp.com/unit-testing/" rel="nofollow">https://os.phil-opp.com/unit-testing/</a>
[2]: <a href="https://os.phil-opp.com/integration-tests/" rel="nofollow">https://os.phil-opp.com/integration-tests/</a><p>The new test framework directly works with `cargo xtest`, which brings the project closer to using standard cargo programs for building, testing, and running. The last remaining step is the `std` Aware Cargo RFC [3]. When the RFC is merged and implemented, cargo-xbuild will no longer be needed and the familiar cargo build, cargo run, and cargo test commands will just work, including IDE integration.<p>[3]: <a href="https://github.com/rust-lang/rfcs/pull/2663" rel="nofollow">https://github.com/rust-lang/rfcs/pull/2663</a>