Skip to main content

test_block_on

Function test_block_on 

Source
pub fn test_block_on<F: Future>(fut: F) -> F::Output
Expand description

Drive an async test body to completion — the driver behind #[epics_test] (epics-macros-rs).

The point of the indirection is that the backend picks the driver, not the test. On tokio_backend this builds exactly what #[tokio::test] builds: a fresh current-thread runtime with IO and time enabled. On exec_backend (the RTEMS target, or a host run with --features rtems-exec-model) no tokio runtime exists to build, so the test thread itself drives the future via park_on, and everything the body spawns or sleeps on lands on the process-global background executor (lazily initialised on first use) — the same seam the RTEMS boot path exercises. A test written with #[epics_test] therefore needs no per-backend gating and no RTEMS-EXEC-MODEL-ALLOW census entry.