Skip to content

Commit 2b41132

Browse files
authored
Merge pull request #201 from IamfromSpace/docs/add-test-run-docs-to-readme
Add documentation on how to run tests to the README.
2 parents 2167e77 + 3428942 commit 2b41132

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,21 @@ expect it to do so.*
126126
## License
127127

128128
[0-clause BSD license](LICENSE-0BSD.txt).
129+
130+
## Contributing
131+
132+
### Running Tests
133+
134+
Tests are run via the integration test pattern and are executed on a target chip, rather than on a host system.
135+
First, install [probe-run](https://crates.io/crates/probe-run) via `cargo install probe-run`.
136+
Next, you'll need to modify `.cargo/config` to link defmt and use `probe-run` configured for your chip.
137+
See details within the comments in that file.
138+
139+
Now, you can execute a test by setting your device, defmt, and any test specific features:
140+
141+
```
142+
cargo test --test rcc --features=stm32f303xc,defmt,rt
143+
```
144+
145+
The result _always_ shows a backtrace, even in the case of success.
146+
Exit code of 0 means that the run was successful.

src/delay.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ impl Delay {
1919
pub fn new(mut syst: SYST, clocks: Clocks) -> Self {
2020
syst.set_clock_source(SystClkSource::Core);
2121

22-
Delay { syst, clocks }
22+
Delay { clocks, syst }
2323
}
2424

2525
/// Releases the system timer (SysTick) resource

0 commit comments

Comments
 (0)