Support for forge coverage
Command
#673
Labels
challenging 🏴☠️
Indicates a difficult item
p1 🟠
Indicates high priority item
upstream-parity 🟰
Needed for upstream feature parity
Currently Blocked by: matter-labs/era-compiler-solidity#160
How it works
2 steps, prepare and collect
prepare:
SourceAnalyzer
, this walks the ast and createsCoverageItems
which are elements that need to be analyzed in coverage paired with aSourceLocation
, which indicates where in the source code they are.4 Look at source maps and create anchors which map bytecode instructions to CoverageItems
collect:
How hit map is built:
There's a CoverageCollector inspector which collects hit maps
This is a mapping of bytecode hash -> HitMap
On each
step
it will add a hit to the program counter of the instructionWhat we would need:
🔗 Useful Links
https://book.getfoundry.sh/reference/forge/forge-coverage?highlight=cforge coverage#examples
The text was updated successfully, but these errors were encountered: