Expand description
BabbleSim + Zephyr nRF RPC simulation bridge.
This crate provides three things:
- Test harness (
spawn_zephyr_rpc_server_with_socat) — spawn a full BabbleSim simulation from Rust integration tests. - xtask CLI (
xtask::cli_main) — docker, zephyr-setup, and run-bsim commands that downstream crates can re-export. - Programmatic setup API (
xtask::fetch_prebuilt_binaries,xtask::zephyr_setup) — call from a downstreambuild.rsor any Rust code without shelling out.
§Test harness usage
use std::collections::HashSet;
use std::path::Path;
let tests_dir = Path::new(concat!(env!("CARGO_MANIFEST_DIR"), "/tests/sockets"));
let (mut processes, socket_path) =
babble_bridge::spawn_zephyr_rpc_server_with_socat(tests_dir, "my_test");
// … run test logic, write/read via a UnixStream to socket_path …
processes.search_stdout_for_strings(HashSet::from([
"<inf> nrf_ps_server: Initializing RPC server",
]));Modules§
- xtask
- Xtask commands (docker, zephyr-setup, run-bsim) and programmatic API.
Structs§
- Test
Processes - Owns all child processes spawned for a single simulation run and accumulates their stdout output for later inspection.
Functions§
- spawn_
zephyr_ rpc_ server_ with_ socat tests_dir/<test_name>.sock.