Enable coverage reporting by setting the corpusDirectory
key in the configuration file and setting the coverageReports
key to ["lcov", "html"]
.
{
"corpusDirectory": "corpus",
"coverageReports": ["lcov", "html"]
}
Linux:
apt-get install lcov
MacOS:
brew install lcov
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.
Install the Coverage Gutters extension.
Then, right click in a project file and select Coverage Gutters: Display Coverage
.