-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* test: create coverage script * feat: add coverage to justfile * chore: log when opening reports
- Loading branch information
1 parent
6ba318b
commit 48498ff
Showing
2 changed files
with
59 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/bin/bash | ||
# | ||
# Generate coverage info for the Solidity contracts. | ||
# | ||
source $(dirname $0)/_functions.sh | ||
|
||
# ------------------------------------------------------------------------------ | ||
# Functions | ||
# ------------------------------------------------------------------------------ | ||
|
||
# Generate a solidity coverage info. | ||
coverage() { | ||
repo=$1 | ||
|
||
if [ -d repos/$repo/coverage/ ]; then | ||
log "Already generated coverage for $repo" | ||
return | ||
fi | ||
|
||
log "Generating coverage: $repo" | ||
|
||
# Enter the repository folder | ||
cd repos/$repo | ||
|
||
npx hardhat coverage | ||
|
||
# Leave the repository folder | ||
cd ../../ | ||
} | ||
|
||
# ------------------------------------------------------------------------------ | ||
# Execution | ||
# ------------------------------------------------------------------------------ | ||
|
||
# configure tools | ||
asdf local solidity 0.8.16 | ||
|
||
# execute | ||
coverage brlc-token | ||
coverage brlc-periphery | ||
coverage brlc-pix-cashier | ||
coverage brlc-yield-streamer | ||
coverage brlc-multisig | ||
coverage compound-periphery | ||
|
||
if [ -n "$1" ] && [ "$1" = "--html" ]; then | ||
log "Opening coverage reports in your web browser..." | ||
open repos/*/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