-
Notifications
You must be signed in to change notification settings - Fork 19
/
test.sh
executable file
·31 lines (24 loc) · 1.01 KB
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env bash
set -e
while getopts t:r:b: flag
do
case "${flag}" in
t) test=${OPTARG};;
r) runs=${OPTARG};;
b) build=${OPTARG};;
esac
done
runs=$([ -z "$runs" ] && echo "10" || echo "$runs")
build=$([ -z "$build" ] && echo "1" || echo "$build")
skip_build=$([ "$build" == "0" ] && echo "1" || echo "0")
[[ $SKIP_MAINNET_CHECK || "$ETH_RPC_URL" && "$(seth chain)" == "ethlive" ]] || { echo "Please set a mainnet ETH_RPC_URL"; exit 1; }
export DAPP_TEST_TIMESTAMP=1615792486
export DAPP_TEST_NUMBER=12045000
export DAPP_SOLC_VERSION=0.6.11
export DAPP_SRC="contracts"
export DAPP_BUILD_OPTIMIZE=1
export DAPP_BUILD_OPTIMIZE_RUNS=200
export DAPP_LINK_TEST_LIBRARIES=1
if [ "$skip_build" = "1" ]; then export DAPP_SKIP_BUILD=1; fi
if [ -z "$test" ]; then match="contracts/test"; dapp_test_verbosity=1; else match=$test; dapp_test_verbosity=2; fi
LANG=C.UTF-8 dapp test --match "$match" --rpc-url "$ETH_RPC_URL" --verbosity $dapp_test_verbosity --cache "cache/dapp-cache" --fuzz-runs $runs