diff --git a/solidity/coverage.sh b/solidity/coverage.sh index 567dd7f044..bd9a3e232d 100755 --- a/solidity/coverage.sh +++ b/solidity/coverage.sh @@ -1,7 +1,10 @@ #!/bin/bash # generates lcov.info -forge coverage --report lcov --no-match-test testFork +forge coverage \ + --report lcov \ + --no-match-test testFork \ + --ir-minimum # https://github.com/foundry-rs/foundry/issues/3357 if ! command -v lcov &>/dev/null; then echo "lcov is not installed. Installing..." @@ -10,14 +13,16 @@ fi lcov --version -# forge does not instrument libraries https://github.com/foundry-rs/foundry/issues/4854 -EXCLUDE="*test* *mock* *node_modules* $(grep -r 'library' contracts -l)" -lcov --rc lcov_branch_coverage=1 \ +# exclude FastTokenRouter until https://github.com/hyperlane-xyz/hyperlane-monorepo/issues/2806 +EXCLUDE="*test* *mock* *node_modules* *FastHyp*" +lcov \ + --rc lcov_branch_coverage=1 \ + --remove lcov.info $EXCLUDE \ --output-file forge-pruned-lcov.info \ - --remove lcov.info $EXCLUDE if [ "$CI" != "true" ]; then - genhtml --rc lcov_branch_coverage=1 \ - --output-directory coverage forge-pruned-lcov.info \ - && open coverage/index.html + genhtml forge-pruned-lcov.info \ + --rc lcov_branch_coverage=1 \ + --output-directory coverage + open coverage/index.html fi