From e58549b2ec06111b0037ce6e282c085dd7c4c84d Mon Sep 17 00:00:00 2001 From: "Christopher J. McClellan" Date: Mon, 31 Dec 2018 07:01:16 -0500 Subject: [PATCH] Add more documentation for testing on host --- examples/test_on_host.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/examples/test_on_host.rs b/examples/test_on_host.rs index b5f386b..1c75ed1 100644 --- a/examples/test_on_host.rs +++ b/examples/test_on_host.rs @@ -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.