# How to run the fuzz tests

1. Build Realm with the AFL-instrumented compilers.

   On Linux:

   ```
   $ CXX=afl-g++ make check-debug-norun COMPILER_IS_GCC_LIKE=yes
   ```

   Or on Mac OS X:

   ```
   $ CXX=afl-clang++ make check-debug-norun COMPILER_IS_GCC_LIKE=yes
   ```

2. Execute the fuzz tester:

   ```
   $ cd test/fuzzy
   $ afl-fuzz -i testcases -o findings ./fuzzy-tests-dbg @@
   ```

3. When AFL detects crashes, it records the input files that it used under `findings/crashes`.
   To debug the crash:

   ```
   $ gdb ./fuzzy-tests-gdb
   > r findings/crashes/<id>
   ```

The `@@` tells AFL where to put command-line arguments (autogenerated input files).
Put specially designed test cases under `testcases`.

The fuzz test can also be run with release mode code to avoid hitting asserts.

See also [AFL's README](http://lcamtuf.coredump.cx/afl/README.txt).

# How to run the fuzz tests

1. Build Realm with the AFL-instrumented compilers.

   On Linux:

   ```
   $ CXX=afl-g++ make check-debug-norun COMPILER_IS_GCC_LIKE=yes
   ```

   Or on Mac OS X:

   ```
   $ CXX=afl-clang++ make check-debug-norun COMPILER_IS_GCC_LIKE=yes
   ```

2. Execute the fuzz tester:

   ```
   $ cd test/fuzzy
   $ afl-fuzz -i testcases -o findings ./fuzzy-tests-dbg @@
   ```

3. When AFL detects crashes, it records the input files that it used under `findings/crashes`.
   To debug the crash:

   ```
   $ gdb ./fuzz-group-gdb
   > r --log findings/crashes/<id>
   ```

    Or using lldb:

    ```
    $ lldb ./fuzz-group-dbg -- --log findings/crashes/<id>
    > r
    ```


The `@@` tells AFL where to put command-line arguments (autogenerated input files).
Put specially designed test cases under `testcases`.

The fuzz test can also be run with release mode code to avoid hitting asserts.

See also [AFL's README](http://lcamtuf.coredump.cx/afl/README.txt).

Update debug instructions for using lldb.
Update debug instructions for using lldb.
