Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Embedded Test
The embedded-test library provides a test harness for embedded systems (riscv and arm). It is based on the idea of defmt-test.
probe-rs test provides a (libtest compatible) test runner, which will:
- Flash all the tests to the device in one go (via probe-rs)
- Request information about all tests from the device (via semihosting SYS_GET_CMDLINE)
- In turn for each testcase:
- Reset the device
- Signal to the device (via semihosting SYS_GET_CMDLINE) which test to run
- Wait for the device to signal that the test completed successfully or with error (via semihosting SYS_EXIT)
- Report the results
Since the test runner (probe-rs test) is libtest compatible (using libtest-mimic), you can use intellij or vscode to run individual tests with the click of a button.

WARNING
This project is in development state. Don't rely on it for anything important yet.
Features
- Runs each test case individually, and resets the device between each test case
- Supports an init function which will be called before each test case and can pass state to the test cases
- Supports async test and init functions (needs feature
embassy) - Support
#[should_panic],#[ignore]and#[timeout(<seconds>)]attributes for each test case
Usage
Add the following to your Cargo.toml:
[[]]
= "example_test"
= false
[]
= {="0.3.0", = ["log"]} # enable log or defmt to see some debug output
# You need a panic handler that invokes `semihosting::process::abort()` on exit.
# For example: Use the patched panic-probe:
= { = "https://github.com/t-moe/defmt", =["print-log"]} # the upstream create does not use semihosting yet
# NOTE: When you use the patched panic-probe, you'll also need to:
# * provide your own exception handler, as panic_probe no longer provides this
# * patch defmt globally, as it is a native library (see below)
[]
= { = "https://github.com/t-moe/defmt" }
= { = "https://github.com/t-moe/defmt" }
Install the runner on your system:
Add the following to your .cargo/config.toml:
[]
# Syntax is: probe-rs test <flash settings> -- <elf> <libtest args>
= "probe-rs test --chip esp32c6 -- "
Then you can run your tests with cargo test or use the button in vscode/intellij.
Example Test
Example repo
More Detailed Cargo.toml
Example for tests/example_test.rs
License
Licensed under either of:
- Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.