Add more documentation for testing on host
This commit is contained in:
@@ -1,5 +1,14 @@
|
||||
//! Conditionally compiling tests with std and our executable with no_std.
|
||||
//!
|
||||
//! Rust's built in unit testing framework requires the standard library,
|
||||
//! but we need to build our final executable with no_std.
|
||||
//! The testing framework also generates a `main` method, so we need to only use the `#[entry]`
|
||||
//! annotation when building our final image.
|
||||
//! For more information on why this example works, see this excellent blog post.
|
||||
//! https://os.phil-opp.com/unit-testing/
|
||||
//!
|
||||
//! Running this example:
|
||||
//!
|
||||
//! Ensure there are no targets specified under `[build]` in `.cargo/config`
|
||||
//! In order to make this work, we lose the convenience of having a default target that isn't the
|
||||
//! host.
|
||||
|
||||
Reference in New Issue
Block a user