embedded-test-0.1.0 has been yanked.
Embedded Test
The embedded-test library provides a test hardness for embedded systems (riscv and arm). It is based on the idea of defmt-test.
The embedded-test binary 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 is libtest compatible (using libtest-mimic), you can use intellij or vscode to run individual tests with the click of a button.

WARNING: Pre-Alpha !!
This project is in pre-alpha state:
TODOs:
- Remove esp32c6 hardcoding, and make chip configurable (along with other probe-rs settings)
- Receive RTT messages in the test runner
- Add support for global setup/teardown and pass state to test cases (like the init functions in defmt-test)
- Add support for async test functions
- Add support for should_error attribute
- Add support for unit return types of tests
Usage
Add the following to your Cargo.toml:
[[]]
= "example_test"
= false
[]
= {="..", = ["log"]} # use log or defmt
= { = "https://github.com/t-moe/defmt"} # the upstream create does not support riscv yet
Install the runner on your system:
Add the following to your .cargo/config.toml:
[]
= "embedded-test"
Example Test
Example for tests/example_test.rs
use esp32c6_hal as _; // exception handler
use panic_probe as _; // semihosting::process::abort on test failure