Skip to content

Commit 8d0b968

Browse files
committed
Move fuzzing into crates directory
1 parent 486daca commit 8d0b968

File tree

18 files changed

+60
-92
lines changed

18 files changed

+60
-92
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -733,11 +733,11 @@ jobs:
733733
with:
734734
path: ~/.cargo/bin/cargo-fuzz
735735
# Change this key if we update the required cargo-fuzz version
736-
key: cargo-fuzz-${{ github.job }}-${{ matrix.name }}-v0-11-1
736+
key: cargo-fuzz-${{ github.job }}-${{ matrix.name }}-v0-11-2
737737

738738
- name: Install cargo-fuzz
739739
if: ${{ matrix.fuzz && steps.fuzz-cache.outputs.cache-hit != 'true' }}
740-
run: cargo install cargo-fuzz --version=^0.11.1
740+
run: cargo install cargo-fuzz --version=^0.11.2
741741

742742
- name: Test Foundation
743743
run: cargo test $ARGS --features=$INTERESTING_FEATURES,catch-all,Foundation
@@ -754,14 +754,14 @@ jobs:
754754
- name: Run fuzzing
755755
if: ${{ matrix.fuzz }}
756756
run: |
757-
# Run each target for 100000 runs (approx. 5 seconds), and timeout
758-
# after 2 seconds.
757+
# Run each fuzz target for 100000 runs (approx. 5 seconds), and
758+
# timeout after 2 seconds.
759759
#
760760
# We specify the number of runs explicitly instead of using
761761
# `max_total_time`, to get more determinism.
762-
for target in $(cargo-fuzz list)
762+
for fuzz_target in $(cargo-fuzz list --fuzz-dir=./crates/test-fuzz/)
763763
do
764-
cargo-fuzz run $target $ARGS -- -runs=10000 -timeout=2 -jobs=10
764+
cargo-fuzz run --fuzz-dir=./crates/test-fuzz/ $fuzz_target $ARGS -- -runs=10000 -timeout=2 -jobs=10
765765
done
766766
767767
# Check if the fuzzer encountered something that should be added to

Cargo.lock

Lines changed: 37 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.

fuzz/Cargo.toml renamed to crates/test-fuzz/Cargo.toml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "fuzz"
2+
name = "test-fuzz"
33
version = "0.0.0"
44
publish = false
55
edition = "2021"
@@ -9,7 +9,7 @@ cargo-fuzz = true
99

1010
[dependencies]
1111
libfuzzer-sys = "0.4"
12-
objc2 = { path = "../crates/objc2", default-features = false }
12+
objc2 = { path = "../objc2", default-features = false }
1313

1414
[features]
1515
default = ["apple", "std"]
@@ -22,9 +22,6 @@ gnustep-1-9 = ["gnustep-1-8", "objc2/gnustep-1-9"]
2222
gnustep-2-0 = ["gnustep-1-9", "objc2/gnustep-2-0"]
2323
gnustep-2-1 = ["gnustep-2-0", "objc2/gnustep-2-1"]
2424

25-
[workspace]
26-
members = ["."]
27-
2825
[[bin]]
2926
name = "class"
3027
path = "fuzz_targets/class.rs"

crates/test-fuzz/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Fuzzing `objc2`
2+
3+
Run using `cargo-fuzz` (note: you must specify the `--fuzz-dir` argument).
4+
5+
```sh
6+
cargo +nightly fuzz run --fuzz-dir=crates/test-fuzz/ $fuzz_target
7+
```
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)