This repository has been archived by the owner on Mar 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 504
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
49 additions
and
1 deletion.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Exit script as soon as a command fails. | ||
set -o errexit | ||
|
||
# Executes cleanup function at script exit. | ||
trap cleanup EXIT | ||
|
||
# get current directory | ||
PWD=$(pwd) | ||
|
||
cleanup() { | ||
echo "Cleaning up" | ||
pkill -f ganache-cli | ||
cd $PWD/test-bor-docker | ||
bash stop-docker.sh | ||
bash clean.sh | ||
cd .. | ||
echo "Done" | ||
} | ||
|
||
start_testrpc() { | ||
npm run test:anvil > /dev/null & | ||
} | ||
|
||
start_blockchain() { | ||
cd $PWD/test-bor-docker | ||
bash run-docker.sh | ||
cd .. | ||
} | ||
|
||
|
||
echo "Starting our own testrpc instance" | ||
start_testrpc | ||
|
||
echo "Starting our own geth instance" | ||
start_blockchain | ||
|
||
if [ "$SOLIDITY_COVERAGE" = true ]; then | ||
npm run coverage "$@" | ||
else | ||
npm run test:hardhat "$@" | ||
npm run test:foundry "$@" | ||
fi | ||
|
||
|