diff options
| author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2022-01-22 22:07:37 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-22 22:07:37 +0000 |
| commit | 69cacd05974b72d1eed7e291cc758d443e23939b (patch) | |
| tree | 2c55943e817d722278c047e101bb3b33b1affc06 /book/en/src/by-example.md | |
| parent | d51aaf3ad3ffb2314f8885515e223ca2f591b5a3 (diff) | |
| parent | a34f0205b383a72a0c4f826657930f7ec29d6b5d (diff) | |
Merge #588
588: Highlight how to run examples locally r=perlindgren a=AfoHT
How examples are run never gets properly introduced before used in `by-example/resources.md`
Fixes #587
Co-authored-by: Henrik Tjäder <henrik@grepit.se>
Diffstat (limited to 'book/en/src/by-example.md')
| -rw-r--r-- | book/en/src/by-example.md | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/book/en/src/by-example.md b/book/en/src/by-example.md index 84f0019..3a523e5 100644 --- a/book/en/src/by-example.md +++ b/book/en/src/by-example.md @@ -15,3 +15,18 @@ Check [the embedded Rust book] for instructions on how to set up an embedded development environment that includes QEMU. [the embedded Rust book]: https://rust-embedded.github.io/book/intro/install.html + +To run the examples found in `examples/` locally, cargo needs a supported `target` and +either `--examples` (run all examples) or `--example NAME` to run a specific example. + +Assuming dependencies in place, running: + +``` console +$ cargo run --target thumbv7m-none-eabi --example locals +``` + +Yields this output: + +``` console +{{#include ../../../ci/expected/locals.run}} +``` |
