diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 688077a..98df11b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,4 +49,4 @@ jobs: mkdir build && cd build cmake -DENABLE_FUZZ=ON .. make fuzz_lexer - ./fuzz_lexer -i ../fuzz/corpus -o ./findings -t 1000 + ./fuzz_lexer -i ../tools/fuzz/corpus -o ./findings -t 1000 diff --git a/README.md b/README.md index 755014a..7077991 100644 --- a/README.md +++ b/README.md @@ -59,14 +59,9 @@ guidelines. ## Fuzzing Tools -Experimental AFL++ harnesses live in `tools/fuzz`. You can build the -lexer fuzzer with Zig and run it against the sample corpus in -`fuzz/corpus` to discover crashes in the lexer and parser: - -```bash -zig build fuzz-lexer -./zig-out/bin/fuzz_lexer -i fuzz/corpus -o findings -``` +Experimental AFL++ harnesses live in `tools/fuzz`. They can be +built with CMake using `-DENABLE_FUZZ=ON` and run against the sample +corpus in `tools/fuzz/corpus` to discover crashes in the lexer and parser. ## Legacy Ouroboros Sources diff --git a/docs/testing.md b/docs/testing.md index 3765730..82a0bf0 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -15,7 +15,8 @@ zig build mod-test If AFL++ is installed you can build the lexer fuzzer using Zig: -```bash -zig build fuzz-lexer -./zig-out/bin/fuzz_lexer -i fuzz/corpus -o findings +``` +cmake -DENABLE_FUZZ=ON .. +make fuzz_lexer +./fuzz_lexer -i ../tools/fuzz/corpus -o ./findings ``` diff --git a/tools/fuzz/README.md b/tools/fuzz/README.md index 3c7e04b..2ae4272 100644 --- a/tools/fuzz/README.md +++ b/tools/fuzz/README.md @@ -6,10 +6,10 @@ This directory contains the AFL++ based lexer fuzzer. Build it using Zig: zig build fuzz-lexer ``` -Provide a seed corpus in `fuzz/corpus` and run the fuzzer: +Provide a seed corpus in `corpus` and run the fuzzer: ```bash -./zig-out/bin/fuzz_lexer -i fuzz/corpus -o findings +./fuzz_lexer -i ../tools/fuzz/corpus -o ./findings ``` Crashes will be written to the `findings` directory for investigation. diff --git a/tools/fuzz/corpus/seed1.ouro b/tools/fuzz/corpus/seed1.ouro new file mode 100644 index 0000000..db91339 --- /dev/null +++ b/tools/fuzz/corpus/seed1.ouro @@ -0,0 +1 @@ +let x = 1;