forked from reach-sh/reach-lang
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·151 lines (123 loc) · 2.65 KB
/
test.sh
File metadata and controls
executable file
·151 lines (123 loc) · 2.65 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
#!/bin/sh -e
ROOT=$(pwd)
REACH=${ROOT}/reach
export REACH_DOCKER=0
${REACH} -h
c () {
echo c "$@"
${REACH} compile --intermediate-files "$@"
}
fc () {
if ! [ -f "$1" ] ; then
echo "$1" does not exist
false
fi
if (c "$1") ; then
false
else
true
fi
}
err () {
fc "hs/t/n/$1.rsh"
}
jb () {
#(cd "$ROOT"/js/js-deps && make build)
(cd "$ROOT"/js/stdlib && make build)
(cd "$ROOT"/js/runner && make build)
#(cd "$ROOT"/js/rpc-server && make build)
#(cd "$ROOT"/js/react-runner && make build)
# (cd "$ROOT"/js && make build)
}
one () {
MODE="$1"
WHICH="$2"
printf "\nONE %s %s\n" "$MODE" "$WHICH"
(cd "examples"
./one.sh clean "${WHICH}"
./one.sh build "${WHICH}"
REACH_DEBUG=1 REACH_CONNECTOR_MODE="${MODE}" ./one.sh run "${WHICH}"
)
}
ci () {
MODE="$1"
WHICH="$2"
printf "\nCI %s %s\n" "$MODE" "$WHICH"
(cd "examples/$WHICH"
${REACH} clean
${REACH} compile --intermediate-files
make build
REACH_DEBUG=1 REACH_CONNECTOR_MODE="$MODE" ${REACH} run
)
}
r () {
printf "\nRun %s\n" "$1"
(cd "$1"
${REACH} clean
rm -f build/*.teal*
${REACH} compile --install-pkgs
${REACH} compile --intermediate-files
# tealcount1 .
make build
# make down
# jb
#export REACH_DEBUG=1
#REACH_CONNECTOR_MODE=ETH ${REACH} run
REACH_CONNECTOR_MODE=ALGO ${REACH} run
#REACH_CONNECTOR_MODE=CFX ${REACH} run
# Ganache
#REACH_CONNECTOR_MODE=ETH-live ETH_NODE_URI=http://host.docker.internal:7545 REACH_ISOLATED_NETWORK=1 ${REACH} run
)
}
tealcount1 () {
if [ -d "${1}/build" ] ; then
for t in "${1}"/build/"${2}"*.teal ; do
td=$(dirname "${t}")
tn=$(basename "${t}")
(cd "${td}" && ("${ROOT}/scripts/goal-devnet" clerk compile "${tn}" || true))
done
SIZE=$(wc -c "${1}"/build/"${2}"*tok | tail -1 | awk '{print $1}')
echo "$1" "$2" - "$SIZE"
wc -c "${1}"/build/"${2}"*tok
fi
}
tealcount () {
for e in examples/* ; do
tealcount1 "$e"
done
}
checkteal () {
c "$1"/index.rsh
./scripts/goal-devnet clerk compile "$1"/build/index.main.appApproval.teal
}
# tealcount
cdot () {
export REACH_DEBUG=Y
c "$1"
dot -Tpng -O "$(dirname "$1")/build/$(basename "$1" .rsh).main.appApproval.cost.dot"
}
#######
#jb
#ci ALGO rps-7-loops
#exit 0
c --install-pkgs users/xbacked-contracts/src/master_vault.rsh
REACH_DEBUG=Y c users/xbacked-contracts/src/master_vault.rsh
exit 0
c hs/t/y/floatOpt.rsh
exit 0
#jb
./scripts/algo-txns/index.sh
exit 0
cdot examples/overview/index.rsh
cdot examples/rps-8-interact/index.rsh
cdot users/duoswap-core/index.rsh
exit 0
jb
ci ALGO api-raw
ci ALGO api-map
exit 0
ci ALGO atomic-swap
ci ALGO mint-basic
#ci ALGO js-tests
exit 0
# (cd hs && mk hs-test)