Skip to content

Commit 3335766

Browse files
committed
correct start.sh script
1 parent b89005d commit 3335766

File tree

2 files changed

+16
-46
lines changed

2 files changed

+16
-46
lines changed

test.sh

Lines changed: 0 additions & 31 deletions
This file was deleted.

test/start.sh

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,30 @@
11
#!/usr/bin/sh
22

3-
ganache-cli -i test > /dev/null &
4-
ganache_pid=$!
3+
function restart_ganache() {
4+
echo "Restart ganache-cli..."
5+
if [ $ganache_pid ]
6+
then
7+
echo "kill old ganache..."
8+
kill -9 $ganache_pid
9+
fi
510

6-
sleep 5
11+
ganache-cli -i test > /dev/null &
12+
ganache_pid=$!
713

8-
echo "truffle test Bank..."
9-
truffle test test/testComplexBank.js test/token/* test/testOracle.js --network testBank
14+
sleep 5
15+
}
1016

11-
kill -9 $ganache_pid
17+
restart_ganache
1218

13-
ganache-cli -i test > /dev/null &
14-
ganache_pid=$!
19+
echo "truffle test Bank..."
20+
truffle test test/testComplexBank.js test/token/* test/testOracle.js --network testBank
1521

16-
sleep 5 > /dev/null
22+
restart_ganache
1723

1824
echo "truffle test Exchanger..."
1925
truffle test test/testLoans.js test/testComplexExchanger.js test/testDeposit.js --network testExchanger
2026

21-
kill -9 $ganache_pid > /dev/null
22-
23-
ganache-cli -i test > /dev/null &
24-
ganache_pid=$!
25-
26-
sleep 5 > /dev/null
27+
restart_ganache
2728

2829
echo "truffle test DAO..."
2930
truffle test test/testAssociation.js --network testDAO

0 commit comments

Comments
 (0)