Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add fuzzers for BTreeMap and MinHeap #217

Merged
merged 7 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
rustup default ${{ matrix.rust }}
rustup component add rustfmt
rustup component add clippy
rustup toolchain install nightly

- name: Check Format
run: cargo fmt --all -- --check
Expand All @@ -39,6 +40,11 @@ jobs:
run: cargo test
env:
RUST_BACKTRACE: 1

- name: Build Fuzzers
run: |
cargo install cargo-fuzz
cargo +nightly fuzz build

examples:
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions fuzz/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
target
corpus
artifacts
coverage
304 changes: 304 additions & 0 deletions fuzz/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 37 additions & 0 deletions fuzz/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[package]
name = "ic-stable-structures-fuzz"
version = "0.0.0"
publish = false
edition = "2021"

[package.metadata]
cargo-fuzz = true

[dependencies]
libfuzzer-sys = "0.4"
arbitrary = {version = "1.3.0", features = ["derive"]}
serde = {version = "1.0", features = ["derive"]}
serde_bytes = "0.11"
serde_cbor = "0.11.2"
tempfile = "3.3.0"

[dependencies.ic-stable-structures]
path = ".."

# Prevent this from interfering with workspaces
[workspace]
members = ["."]

[[bin]]
name = "stable_btreemap_multiple_ops_persistent"
path = "fuzz_targets/stable_btreemap_multiple_ops_persistent.rs"
test = false
doc = false
bench = false

[[bin]]
name = "stable_minheap_multiple_ops_persistent"
path = "fuzz_targets/stable_minheap_multiple_ops_persistent.rs"
test = false
doc = false
bench = false
Loading