Run cargo test in your project directory to execute all unit and integration tests for your embedded Rust code. For mdbook projects, you must first build external dependencies and then run mdbook test with the correct library path.
cargo test
For mdbook projects with external crates like trpl:
cd packages/trpl && cargo build
mdbook test --library-path packages/trpl/target/debug/deps