-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add deposit too large and withdraw
- Loading branch information
Showing
4 changed files
with
52 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,8 @@ out/ | |
# Dotenv file | ||
.env | ||
.vscode | ||
lcov.info | ||
lcov.info | ||
|
||
# Coverage directory | ||
coverage/ | ||
*.info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/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..." | ||
# check if its macos or linux. | ||
if [ "$(uname)" == "Darwin" ]; then | ||
brew install lcov | ||
else | ||
sudo apt-get install lcov | ||
fi | ||
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 \ | ||
--ignore-errors category \ | ||
--output-directory coverage forge-pruned-lcov.info \ | ||
&& open coverage/index.html | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters