Skip to main content

Crate test_r

Crate test_r 

Source

Re-exports§

pub use ::ctor;

Modules§

core

Macros§

add_test
define_matrix_dimension
enable
inherit_test_dep
sequential_suite
tag_suite
timeout_suite

Structs§

AsyncBencher
Bencher

Traits§

AsyncHostedDep
Async counterpart of HostedDep. Implement this when worker-side reconstruction needs to .await (e.g. opening async network clients, doing async filesystem work, calling Provided*::new(...).await constructors).
AsyncHostedRpcDep
Async counterpart of HostedRpcDep. Implement this when the owner-side method dispatcher needs to .await (e.g. controlling subprocesses, holding tokio::sync locks, calling other async APIs).
CloneableDep
User-facing trait that opts a dependency value into the Cloneable sharing strategy. The parent calls to_wire once and ships the bytes to each worker via IPC. Each worker calls from_wire to reconstruct a local value.
HostedDep
User-facing trait that opts a dependency value into the Hosted sharing strategy. Like CloneableDep, but the owner instance lives in the parent test runner process for the entire suite. The parent runs the constructor once per Hosted dep and keeps the value alive until every worker has finished — useful for singleton services like an in-process TCP listener, a Docker container, an env-based test environment, or any long-running runtime that must not be duplicated across worker processes.
HostedRpcDep
User-facing trait that opts a dependency value into the HostedRpc sharing strategy. Like HostedDep, the owner lives in the parent test runner process for the entire suite; unlike Hosted, workers do NOT see the owner type — they see a separate Stub type that calls back into the parent over the existing IPC socket through a small generated method-dispatch table.

Functions§

spawn
Spawn a future on the tokio runtime with test context propagation. If the spawned task panics and the test uses DetachedPanicPolicy::FailTest (default), the panic will be reported as a test failure after the test body completes.
spawn_thread
Spawn a thread with test context propagation. If the spawned thread panics and the test uses DetachedPanicPolicy::FailTest (default), the panic will be reported as a test failure after the test body completes.
worker_index
Returns the zero-based worker index assigned to this OS process.

Attribute Macros§

always_capture
always_ensure_time
always_report_time
bench
flaky
hosted_rpc
HR1.1: trait-driven boilerplate eliminator for HostedRpcDep / AsyncHostedRpcDep.
ignore_detached_panics
never_capture
never_ensure_time
never_report_time
non_flaky
sequential
tag
test
test_dep
test_gen
timeout