You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: fuzz/README.md
+65Lines changed: 65 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -84,3 +84,68 @@ You can therefore run the following(still from the root directory) to fuzz all t
84
84
```
85
85
86
86
This will run each of the fuzz targets we have created for 5 minutes.
87
+
88
+
### Generate code-coverage data
89
+
90
+
Code coverage data helps identify which code paths are exercised during fuzzing. This information shows which parts of the code remain untested, so you can take steps such as adding fuzz targets with different entry points or expanding the corpus with new seed inputs. You can find more details in the [Rust Fuzz Book](https://rust-fuzz.github.io/book/cargo-fuzz/coverage.html).
91
+
92
+
The following instructions use the `isis_pdu_decode` fuzz target as an example.
93
+
94
+
#### 1. Run the fuzz target
95
+
96
+
Begin by running the fuzz target for a long period to exercise as many code paths as possible. The `-j` option allows multiple fuzzer instances to run in parallel while sharing the same corpus.
97
+
```
98
+
cargo fuzz run -j 8 isis_pdu_decode
99
+
```
100
+
101
+
#### 2. Generate coverage data
102
+
103
+
Once the fuzz run has completed, generate coverage information:
104
+
```
105
+
cargo fuzz coverage isis_pdu_decode
106
+
```
107
+
108
+
#### 3. Generate a coverage report
109
+
110
+
A text-based coverage report can be generated using `llvm-cov` as follows:
0 commit comments