| Crates.io | bare-test |
| lib.rs | bare-test |
| version | 0.7.0 |
| created_at | 2024-10-31 08:53:21.419698+00 |
| updated_at | 2025-09-24 08:21:08.570838+00 |
| description | A test framework for bare metal. |
| homepage | |
| repository | https://github.com/ZR233/sparreal-os/tree/main/crates/bare-test |
| max_upload_size | |
| id | 1429816 |
| size | 85,706 |
A test framework for testing the bare metal.
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 tests dir and add test.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