Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lcov-report #38

Closed
wants to merge 5 commits into from
Closed

Lcov-report #38

wants to merge 5 commits into from

Conversation

ingoCollatz
Copy link
Contributor

No description provided.

.lcov_filtered

coverage-report/
Copy link
Member

@benjaminbollen benjaminbollen Aug 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should also include lcov.info and lcov_filtered.info

4. **Generate the HTML Report:**
To create an HTML report from the filtered `lcov` data, use:
```sh
genhtml lcov_filtered.info --output-directory coverage-report --ignore-errors inconsistent,corrupt
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you want to instead address the specific error only::

genhtml lcov_filtered.info --output-directory coverage-report --rc derive_function_end_line=0

see the warning in the forge docs for explanation https://book.getfoundry.sh/reference/forge/forge-coverage#description

3. **Filter the Coverage Data:**
To ensure that only files from the `src` directory are included in the report, filter the coverage data:
```sh
lcov --remove lcov.info 'test/*' -o lcov_filtered.info --ignore-errors inconsistent
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same remark as below: you only want to address the actual error by instead calling

lcov --remove lcov.info 'test/*' -o lcov_filtered.info --rc derive_function_end_line=0      

this error is mentioned in the forge docs (see link below)

@@ -67,6 +67,53 @@ This Solidity project uses Foundry as a toolkit. If you don't have Foundry insta
forge snapshot
```

### Generating Code Coverage Report
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for the readme, forge coverage works out of the box, and so I think this more detailed description is too much for the readme. I ll set it up in a script and we can run a hosted version of the coverage report and then just link the results to the readme

@benjaminbollen
Copy link
Member

Good work, but the PR still contains the outputs and as mentioned, let's just set it up as a hosted service with the results reported back in the readme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants