OLD | NEW |
1 # libFuzzer Integration Reference | 1 # libFuzzer Integration Reference |
2 | 2 |
3 ## fuzzer_test GN Template | 3 ## fuzzer_test GN Template |
4 | 4 |
5 Use `fuzzer_test` to define libFuzzer targets: | 5 Use `fuzzer_test` to define libFuzzer targets: |
6 | 6 |
7 ``` | 7 ``` |
8 fuzzer_test("my_fuzzer") { | 8 fuzzer_test("my_fuzzer") { |
9 ... | 9 ... |
10 } | 10 } |
(...skipping 22 matching lines...) Expand all Loading... |
33 Most common flags are: | 33 Most common flags are: |
34 | 34 |
35 | Flag | Description | | 35 | Flag | Description | |
36 |------|-------------| | 36 |------|-------------| |
37 | max_len | Maximum length of test input. | | 37 | max_len | Maximum length of test input. | |
38 | timeout | Timeout of seconds. Units slower than this value will be reported as
bugs. | | 38 | timeout | Timeout of seconds. Units slower than this value will be reported as
bugs. | |
39 | 39 |
40 A fuller list of options can be found at [libFuzzer Usage] page and by running | 40 A fuller list of options can be found at [libFuzzer Usage] page and by running |
41 the binary with `-help=1`. | 41 the binary with `-help=1`. |
42 | 42 |
43 To specify these options for ClusterFuzz, create `<my_fuzzer>.options` file: | 43 To specify these options for ClusterFuzz, list all parameters in |
| 44 `libfuzzer_options` target attribute: |
44 | 45 |
45 ``` | 46 ``` |
46 [libfuzzer] | 47 fuzzer_test("my_fuzzer") { |
47 max_len=500 | 48 ... |
| 49 libfuzzer_options = [ |
| 50 "max_len=2048", |
| 51 "use_traces=1", |
| 52 ] |
| 53 } |
48 ``` | 54 ``` |
49 | 55 |
50 and specify the file in `libfuzzer_options` target attribute. | |
51 | |
52 [libFuzzer Usage]: http://llvm.org/docs/LibFuzzer.html#usage | 56 [libFuzzer Usage]: http://llvm.org/docs/LibFuzzer.html#usage |
53 | 57 |
54 | 58 |
OLD | NEW |