Skip to content

Should forge coverage skip libraries? #4654

@llllvvuu

Description

@llllvvuu

Component

Forge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.2.0 (6c1eee9 2023-03-27T00:12:53.527941Z)

What command(s) is the bug in?

forge coverage

Operating System

macOS (Apple Silicon)

Describe the bug

It's quite alarming to see as the first thing, when code is fully fuzzed and tests are passing:

| File                          | % Lines      | % Statements | % Branches   | % Funcs     |
|-------------------------------|--------------|--------------|--------------|-------------|
| library.sol | 0.00% (0/42) | 0.00% (0/54) | 0.00% (0/28) | 0.00% (0/4) |
| Total                         | 0.00% (0/42) | 0.00% (0/54) | 0.00% (0/28) | 0.00% (0/4) |

Developer has to turn on RUST_LOG=warn and dig back to this: #2504 , to find out that forge coverage doesn't work with libraries.

Maybe the above example should show (0/0) throughout the library.sol row and have another row above "Total" saying "Skipped" that would have the original 0.00% (0/42) | 0.00% (0/54) | 0.00% (0/28) | 0.00% (0/4)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Completed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions