Skip to content

Commit d4361a1

Browse files
committed
Remove default aarch64 target; add instructions for running cross tests
1 parent 4faa1fe commit d4361a1

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

.vscode/settings.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
22
"rust-analyzer.cargo.features": [
33
"rt",
4-
"stm32h503"
4+
"stm32h503",
5+
"async",
56
],
67
"rust-analyzer.check.allTargets": false,
78
"rust-analyzer.check.targets": "thumbv8m.main-none-eabihf",
8-
}
9+
}

Cross.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# Cross doesn't seem to look for package specific configurations when invoked in a workspace so
22
# we put the default target in Cross.toml
33

4-
[build]
5-
default-target = "aarch64-unknown-linux-gnu"
6-
74
# Allow usage of locally built version of the cross docker image that matches the host architecture
85
# e.g. Building a linux/arm64 image for an AARCH64 host allows native execution of the image.
96
# Specifying the toolchain for a linux/arm64 image means the correct toolchain is used on that

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,20 @@ a number of fantastic resources available to help.
7171
- [Rust Embedded FAQ](https://docs.rust-embedded.org/faq.html)
7272
- [rust-embedded/awesome-embedded-rust](https://github.com/rust-embedded/awesome-embedded-rust)
7373

74+
## Running unit tests
75+
76+
First, you'll need to install the `aarch64-unknown-linux-gnu` target to run unit tests.
77+
78+
If you're on a linux host, you can to run unit tests with `cargo test`.
79+
80+
If you're not, you'll need to install [`cross`](https://github.com/cross-rs/cross), which is a cross compilation tool. See the `cross` instructions for details of installation and use. Once that is installed, using `cross test` will run the unit tests within a docker image.
81+
82+
Running tests with `cross`:
83+
84+
cross test --target x86_64-unknown-linux-gnu --tests --features stm32h503
85+
86+
`cross` will automatically download the relevant docker image and install the correct rust toolchain.
87+
7488
## Changelog
7589

7690
See [CHANGELOG.md](CHANGELOG.md). Note: this will be populated once the first crates have been

0 commit comments

Comments
 (0)