forge coverage for libraries is not updating
Component
Forge
Have you ensured that all of these are up to date?
- [X] Foundry
- [X] Foundryup
What version of Foundry are you on?
forge 0.2.0 (a5efe4f 2024-02-08T00:16:00.244105000Z)
What command(s) is the bug in?
forge coverage
Operating System
macOS (Apple Silicon)
Describe the bug
I am writing unit tests for some libraries and am getting 0% coverage with forge coverage. Feel free to look at this branch as an example! https://github.com/Uniswap/relayer/pull/57
I believe this is a duplicate of https://github.com/foundry-rs/foundry/issues/2567
EDIT: the PR that is referenced in the issue says:
This does not currently handle cases where using for is used for internal libraries since it seems like we lose information on what libraries were bound to what types..
A potential workaround is calling the library explicitly e.g. MyLib.helper(MyType) instead of using MyLib for MyType
@0xalpharush
I moved to using the library explicitly and I'm still not seeing updates in forge coverage. See commits here https://github.com/Uniswap/relayer/pull/57
@0xalpharush I'm having a similar issue. I've tried calling my library functions explicitly and still don't see the coverage being updated. Are there other workarounds to this?