-
Notifications
You must be signed in to change notification settings - Fork 16
FAQ and common errors
Timo edited this page May 31, 2024
·
8 revisions
Most common errors:
This can happen if you invoke cargo test
without any additional arguments. Apparently cargo test
wants to also test the binaries...
Adding the following to Cargo.toml
helps as a workaround.
[[bin]]
name = "embedded-example-test"
path = "src/main.rs"
+ test = false
Alternatively, you can also run cargo test --tests
to only run the integration tests.
Make sure you've added the following line to your build.rs
linker script:
println!("cargo::rustc-link-arg-tests=-Tembedded-test.x");
You can also add rustflags = [ "-C", "link-arg=-Tembedded-test.x" ]
to your .cargo/config.toml
file. But then you need to move embedded-test
from [dev-dependencies]
to [dependencies]
in your Cargo.toml
.