Add a cargo-fuzz harness exercising the runtime under arbitrary actor spawn/send/inbox sequences in both single- and multi-threaded modes. - fuzz/Cargo.toml: add an isolated `swactor-fuzz` package (own standalone workspace) wiring libfuzzer-sys + arbitrary against the `swactor` crate, with `fuzz_runtime` and `fuzz_mt` bin targets - fuzz/fuzz_targets/fuzz_runtime.rs: single-threaded model target running randomized scenarios over Echo/Counter/Forwarder/Spawner/Bomber/Noop/WrongType actors with shared-inbox draining and invariant checks - fuzz/fuzz_targets/fuzz_mt.rs: multi-threaded target driving a live `Runtime`/`RuntimeHandle` across 2-4 threads with spawn/send/burst/inbox actions and `check_invariants` (worker/actor counts) after each run - fuzz/fuzz_targets: both targets derive a `FuzzInput`/`Action` model from `arbitrary`, cap the action count, and support opt-in run tracing via the `FUZZ_LOG` env var - .gitignore: ignore fuzz corpus and artifact output Signed-off-by: Zachery Aaron Shores-Chmielewski <zacheryasc@gmail.com>
27 lines
539 B
TOML
27 lines
539 B
TOML
[package]
|
|
name = "swactor-fuzz"
|
|
version = "0.0.0"
|
|
publish = false
|
|
edition = "2024"
|
|
|
|
[package.metadata]
|
|
cargo-fuzz = true
|
|
|
|
[dependencies]
|
|
libfuzzer-sys = { version = "0.4", features = ["arbitrary-derive"] }
|
|
arbitrary = { version = "1", features = ["derive"] }
|
|
swactor = { path = "..", default-features = true }
|
|
|
|
# Prevent this from interfering with workspaces
|
|
[workspace]
|
|
members = ["."]
|
|
|
|
[[bin]]
|
|
name = "fuzz_runtime"
|
|
path = "fuzz_targets/fuzz_runtime.rs"
|
|
doc = false
|
|
|
|
[[bin]]
|
|
name = "fuzz_mt"
|
|
path = "fuzz_targets/fuzz_mt.rs"
|
|
doc = false
|