1<!--
2Copyright (C) Internet Systems Consortium, Inc. ("ISC")
3
4SPDX-License-Identifier: MPL-2.0
5
6This Source Code Form is subject to the terms of the Mozilla Public
7License, v. 2.0.  If a copy of the MPL was not distributed with this
8file, you can obtain one at https://mozilla.org/MPL/2.0/.
9
10See the COPYRIGHT file distributed with this work for additional
11information regarding copyright ownership.
12-->
13
14= Fuzzing
15
16The tests in this directory can be operated in three modes:
17
18* non-fuzzing - the test just runs over all input located in `<test_name>.in/`
19  directory by compiling with mock main.c that walks through the directory and
20  runs `LLVMFuzzerTestOneInput()` over the input files
21* AFL - `./configure --with-fuzzing=afl` will either feed the stdin to
22  `LLVMFuzzerTestOneInput()` or run the `__AFL_LOOP(10000)` if compiled with
23  `afl-clang-fast`
24* LibFuzzer - `./configure --with-fuzzing=libfuzzer` will disable `main.c`
25  completely and it uses the standard LibFuzzer mechanims to feed
26  `LLVMFuzzerTestOneInput` with the fuzzer
27
28== Test Cases
29
30Each test case should be called descriptively and the executable target must
31link `testcase.o` and `main.o` and the `test_case.c` must have a function
32`LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)`.
33
34== Adding more fuzzers
35
36To add a different fuzzer, `main.c` must be modified to include `main()` function
37for a specific fuzzer (or no function as is case with LibFuzzer).
38