README
1# JS Fuzzing Interface
2
3This directory contains fuzzing targets that implement the unified fuzzing
4interface to be used with libFuzzer or AFL.
5
6## Building the fuzzing targets
7
8To include this directory in your JS build, you need to build with Clang
9and the --enable-fuzzing flag enabled. The build system will automatically
10detect if you are building with afl-clang-fast for AFL or regular Clang
11for libFuzzer.
12
13## Running a fuzzing target
14
15To run a particular target with libFuzzer, use:
16
17 cd $OBJDIR/dist/bin
18 FUZZER=YourTargetName ./fuzz-tests
19
20To run with AFL, use something like
21
22 cd $OBJDIR/dist/bin
23 FUZZER=YourTargetName MOZ_FUZZ_TESTFILE=input \
24 afl-fuzz <regular AFL options> -f input ./fuzz-tests
25
26
27## Writing a fuzzing target
28
291. Check testExample.cpp for a target skeleton with comments.
30
312. Add your own .cpp file to UNIFIED_SOURCES in moz.build
32