-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update coverage reports documentation (#493)
- Loading branch information
Showing
3 changed files
with
43 additions
and
45 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,43 @@ | ||
## Coverage Reports | ||
|
||
### Generating HTML Report from LCOV | ||
|
||
Enable coverage reporting by setting the `corpusDirectory` key in the configuration file and setting the `coverageReports` key to `["lcov", "html"]`. | ||
|
||
```json | ||
{ | ||
"corpusDirectory": "corpus", | ||
"coverageReports": ["lcov", "html"] | ||
} | ||
``` | ||
|
||
### Install lcov and genhtml | ||
|
||
Linux: | ||
|
||
```bash | ||
apt-get install lcov | ||
``` | ||
|
||
MacOS: | ||
|
||
```bash | ||
brew install lcov | ||
``` | ||
|
||
### Generate LCOV Report | ||
|
||
```bash | ||
genhtml corpus/coverage/lcov.info --output-dir corpus --rc derive_function_end_line=0 | ||
``` | ||
|
||
> [!WARNING] | ||
> ** The `derive_function_end_line` flag is required to prevent the `genhtml` tool from crashing when processing the Solidity source code. ** | ||
Open the `corpus/index.html` file in your browser or follow the steps to use VSCode below. | ||
|
||
### View Coverage Report in VSCode with Coverage Gutters | ||
|
||
Install the [Coverage Gutters](https://marketplace.visualstudio.com/items?itemName=ryanluker.vscode-coverage-gutters) extension. | ||
|
||
Then, right click in a project file and select `Coverage Gutters: Display Coverage`. |