The home for Hyperlane core contracts, sdk packages, and other infrastructure
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
hyperlane-monorepo/solidity/coverage.sh

23 lines
670 B

#!/bin/bash
# generates lcov.info
forge coverage --report lcov --no-match-test testFork
if ! command -v lcov &>/dev/null; then
echo "lcov is not installed. Installing..."
sudo apt-get install lcov
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 \
--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
fi