forge coverage skips main contract entirely — not shown in CLI table or LCOV output
#12185
-
SummaryWhen running
All other files (scripts, mocks, helper contracts, etc.) appear normally.
forge coverage --report lcov
Example OutputCLI summary: But LCOV snippet: No entry exists for ✅ What Works
❌ What Fails
⚙️ foundry.toml[profile.default]
src = "src"
out = "out"
test = "test"
libs = ["lib"]
remappings = [
"@chainlink/contracts=lib/chainlink-brownie-contracts/contracts/",
"@openzeppelin/=lib/openzeppelin-contracts/",
"@forge-std/=lib/forge-std/src/",
]EnvironmentAdditional Context
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
|
This is a known issue with 1. Use
|
Beta Was this translation helpful? Give feedback.
-
|
One more thing to check: you are on Forge So I would try this order: foundryup
forge clean
forge coverage --report lcov
grep '^SF:' lcov.info | sortThen try The Foundry docs warn that |
Beta Was this translation helpful? Give feedback.
-
|
Firstly, I want to thank everyone for their input. I’ll go ahead and mark this thread as resolved based on the answers provided. I did manage to solve the issue back then, although I don’t recall the exact step that fixed it. It may have simply been a temporary VS Code issue. Thanks again for the help and the valuable insights! |
Beta Was this translation helpful? Give feedback.
One more thing to check: you are on Forge
1.4.2, and the current stable line is newer now.So I would try this order:
Then try
--ir-minimumonly as a workaround, not as the final answer.The Foundry docs warn that
--ir-minimumcan make coverage less accurate because code gets inlined. So ifDSCEngine.solstill disappears after an upgrade, I would treat it as a coverage bug, not as proof that your tests are wrong.