Skip to content

Commit

Permalink
Merge pull request #201 from IamfromSpace/docs/add-test-run-docs-to-r…
Browse files Browse the repository at this point in the history
…eadme

Add documentation on how to run tests to the README.
  • Loading branch information
Sh3Rm4n authored Mar 1, 2021
2 parents 2167e77 + 3428942 commit 2b41132
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,21 @@ expect it to do so.*
## License

[0-clause BSD license](LICENSE-0BSD.txt).

## Contributing

### Running Tests

Tests are run via the integration test pattern and are executed on a target chip, rather than on a host system.
First, install [probe-run](https://crates.io/crates/probe-run) via `cargo install probe-run`.
Next, you'll need to modify `.cargo/config` to link defmt and use `probe-run` configured for your chip.
See details within the comments in that file.

Now, you can execute a test by setting your device, defmt, and any test specific features:

```
cargo test --test rcc --features=stm32f303xc,defmt,rt
```

The result _always_ shows a backtrace, even in the case of success.
Exit code of 0 means that the run was successful.
2 changes: 1 addition & 1 deletion src/delay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ impl Delay {
pub fn new(mut syst: SYST, clocks: Clocks) -> Self {
syst.set_clock_source(SystClkSource::Core);

Delay { syst, clocks }
Delay { clocks, syst }
}

/// Releases the system timer (SysTick) resource
Expand Down

0 comments on commit 2b41132

Please sign in to comment.