File tree Expand file tree Collapse file tree 3 files changed +43
-45
lines changed Expand file tree Collapse file tree 3 files changed +43
-45
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ value to `10_000` or `100_000` depending on the use case. You can learn more abo
4343Updating the corpus directory is optional but recommended. The corpus directory determines where corpus items should be
4444stored on disk. A corpus item is a sequence of transactions that increased ` medusa ` 's coverage of the system. Thus, these
4545corpus items are valuable to store so that they can be re-used for the next fuzzing campaign. Additionally, the directory
46- will also hold [ coverage reports] ( ../coverage_reports.md ) which is a valuable tool for debugging and validation. For most cases, you may set
46+ will also hold [ coverage reports] ( ../testing/ coverage_reports.md ) which is a valuable tool for debugging and validation. For most cases, you may set
4747` corpusDirectory ` 's value to "corpus". This will create a ` corpus/ ` directory in the same directory as the ` medusa.json `
4848file.
4949You can learn more about this option [ here] ( ./fuzzing_config.md#corpusdirectory ) .
Original file line number Diff line number Diff line change 11## Coverage Reports
2+
3+ ### Generating HTML Report from LCOV
4+
5+ Enable coverage reporting by setting the ` corpusDirectory ` key in the configuration file and setting the ` coverageReports ` key to ` ["lcov", "html"] ` .
6+
7+ ``` json
8+ {
9+ "corpusDirectory" : " corpus" ,
10+ "coverageReports" : [" lcov" , " html" ]
11+ }
12+ ```
13+
14+ ### Install lcov and genhtml
15+
16+ Linux:
17+
18+ ``` bash
19+ apt-get install lcov
20+ ```
21+
22+ MacOS:
23+
24+ ``` bash
25+ brew install lcov
26+ ```
27+
28+ ### Generate LCOV Report
29+
30+ ``` bash
31+ genhtml corpus/coverage/lcov.info --output-dir corpus --rc derive_function_end_line=0
32+ ```
33+
34+ > [ !WARNING]
35+ > ** The ` derive_function_end_line ` flag is required to prevent the ` genhtml ` tool from crashing when processing the Solidity source code. **
36+
37+ Open the ` corpus/index.html ` file in your browser or follow the steps to use VSCode below.
38+
39+ ### View Coverage Report in VSCode with Coverage Gutters
40+
41+ Install the [ Coverage Gutters] ( https://marketplace.visualstudio.com/items?itemName=ryanluker.vscode-coverage-gutters ) extension.
42+
43+ Then, right click in a project file and select ` Coverage Gutters: Display Coverage ` .
You can’t perform that action at this time.
0 commit comments