-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
No coverage report inside do...while
loops
#6968
Comments
do...while
loopsdo...while
loops
I did a little bit of digging for this one, my first guess was an error with the visitor implementation but it was not the case, it looks like foundry/crates/forge/src/coverage.rs Lines 119 to 120 in e897bd6
By changing it to emit I have the change, produced this coverage report here on my fork: I can open a PR but if we have some context on why the comment said statements are not compatible, that would be great. I don't want to introduce a regression. |
Thanks a lot for looking into this! The fixed example you showed looks great, hopefully someone can confirm it wouldn't cause problems elsewhere. |
@onbjerg since git blame points at you maybe you can pitch in? Thanks ^^ |
we can add DA to lcov but note that expressions and statements are two different constructs please open a PR - coverage does not cover everything because we had to reconstruct the AST data structure ourselves since it is undocumented in solidity, and even worse, changes over different versions. |
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (caef136 2024-01-29T00:20:25.410303708Z)
What command(s) is the bug in?
forge coverage --report lcov
Operating System
Linux
Describe the bug
The coverage report generated by foundry does not include any coverage information inside
do...while
loops.Repro: https://github.com/beeb/repro_foundry_coverage
Report below was generated with lcov's
genhtml
using the report generated by forge.The text was updated successfully, but these errors were encountered: