19 releases (7 breaking)
Uses new Rust 2024
| 0.7.0 | Sep 24, 2025 |
|---|---|
| 0.5.0 | Jul 18, 2025 |
| 0.4.1 | Mar 23, 2025 |
| 0.2.0 | Dec 10, 2024 |
| 0.1.3 | Nov 14, 2024 |
#350 in Testing
29 downloads per month
Used in 6 crates
24KB
88 lines
Bare Test
A test framework for testing the bare metal.
Usage
-
Install
ostool.cargo install ostool -
setup
.cargo/config.toml[target.'cfg(all(target_os = "none"))'] runner = "ostool cargo-test" [build] target = "aarch64-unknown-none" -
setup
cargo.toml.[dev-dependencies] bare-test = "0.2" [build-dependencies] bare-test-macros = "0.2" [[test]] name = "test" harness = false -
setup
build.rs.fn main() { bare_test_macros::build_test_setup!(); } -
new
testsdir and addtest.rs.#![no_std] #![no_main] #![feature(used_with_arg)] #[bare_test::tests] mod tests { #[test] fn it_works() { assert_eq!(2 + 2, 4) } #[test] fn test2() { assert_eq!(2 + 2, 4) } } -
run
cargo test --test test -- --show-output. -
for uboot board test:
cargo test --test tests -- --show-output --uboot
Dependencies
~4–7MB
~112K SLoC