5 使用 Foundry coverage 生成 lcov 文件后,再使用 genhtml 生成 html 会失败

合约的仓库是:

https://github.com/RohanNero/learn-foundry-coverage

首先使用如下命令生成 lcov 文件:

forge coverage --report lcov

生成了 lcov.info 文件后,再使用如下命令生成html:

genhtml lcov.info -o report --branch-coverage

但是报错:

Reading tracefile lcov.info.
genhtml: ERROR: (corrupt) unable to read trace file 'lcov.info': genhtml: ERROR: (inconsistent) "script/Counter.s.sol":7:  function CounterScript.setUp found on line but no corresponding 'line' coverage data point.  Cannot derive function end line.  See lcovrc man entry for 'derive_function_end_line'.
    (use "genhtml --ignore-errors inconsistent ..." to bypass this error)
    (use "genhtml --ignore-errors corrupt ..." to bypass this error)
请先 登录 后评论

1 个回答

Wade - Footprint Analytics CTO
  擅长:数据分析,GameFi,NFT
请先 登录 后评论