File tree 5 files changed +70
-53
lines changed
5 files changed +70
-53
lines changed Original file line number Diff line number Diff line change 1
1
module . exports = {
2
- norpc : true ,
2
+ compileCommand : 'node --max-old-space-size=4096 ../node_modules/.bin/truffle compile --network development' ,
3
+ testCommand : 'node --max-old-space-size=4096 ../node_modules/.bin/truffle test --network development' ,
3
4
skipFiles : [
4
5
'contracts/Migrations.sol' ,
5
6
'contracts/implementation.sol'
Original file line number Diff line number Diff line change 17
17
},
18
18
"dependencies" : {},
19
19
"scripts" : {
20
- "coverage" : " ./node_modules/.bin/solidity- coverage" ,
20
+ "coverage" : " scripts/ coverage.sh " ,
21
21
"build" : " truffle compile" ,
22
22
"migrate" : " truffle migrate" ,
23
23
"test" : " scripts/test.sh"
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ source $( dirname " $0 " ) /utils.sh
4
+ check_truffle_project
5
+ trap kill_ganache SIGINT SIGTERM SIGTSTP
6
+ run_ganache
7
+ run_coverage
8
+ kill_ganache
9
+ exit 0
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
- # Test script should be run in the base directory
4
- check_truffle_project () {
5
- cd ` dirname " $0 " ` && cd ../
6
- if [ -f " truffle.js" ]
7
- then
8
- echo " Start testing"
9
- else
10
- echo " You should run this script in the base directory of this project"
11
- exit 1
12
- fi
13
- }
14
-
15
- # Terminate running ganaches for testing
16
- kill_ganache () {
17
- echo " Terminate ganache"
18
- if ! ([ -z ${pid+x} ]); then
19
- kill $pid > /dev/null 2>&1
20
- fi
21
- }
22
-
23
- # Compile contracts
24
- compile () {
25
- truffle compile --all
26
- [ $? -ne 0 ] && exit 1
27
- }
28
-
29
- # Run private block-chain for test cases
30
- run_ganache () {
31
- ganache-cli > /dev/null & pid=$!
32
- if ps -p $pid > /dev/null
33
- then
34
- echo " Running ganache..."
35
- else
36
- echo " Failed to run a chain"
37
- exit 1
38
- fi
39
- }
40
-
41
- # Deploy contracts on the block-chain for testing
42
- migrate () {
43
- truffle migrate --network development
44
- [ $? -ne 0 ] && exit 1
45
- }
46
-
47
- # Run test cases with truffle
48
- run_test () {
49
- truffle test --network development
50
- [ $? -ne 0 ] && exit 1
51
- }
52
-
53
- trap kill_ganache SIGINT SIGTERM SIGTSTP
3
+ source $( dirname " $0 " ) /utils.sh
54
4
check_truffle_project
5
+ trap kill_ganache SIGINT SIGTERM SIGTSTP
55
6
run_ganache
56
7
run_test
57
8
kill_ganache
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Test script should be run in the base directory
4
+ check_truffle_project () {
5
+ cd ` dirname " $0 " ` && cd ../
6
+ if [ -f " truffle.js" ]
7
+ then
8
+ echo " Start testing"
9
+ else
10
+ echo " You should run this script in the base directory of this project"
11
+ exit 1
12
+ fi
13
+ }
14
+
15
+ # Terminate running ganaches for testing
16
+ kill_ganache () {
17
+ echo " Terminate ganache"
18
+ if ! ([ -z ${pid+x} ]); then
19
+ kill $pid > /dev/null 2>&1
20
+ fi
21
+ }
22
+
23
+ # Compile contracts
24
+ compile () {
25
+ truffle compile --all
26
+ [ $? -ne 0 ] && exit 1
27
+ }
28
+
29
+ # Run private block-chain for test cases
30
+ run_ganache () {
31
+ ganache-cli > /dev/null & pid=$!
32
+ if ps -p $pid > /dev/null
33
+ then
34
+ echo " Running ganache..."
35
+ else
36
+ echo " Failed to run a chain"
37
+ exit 1
38
+ fi
39
+ }
40
+
41
+ # Deploy contracts on the block-chain for testing
42
+ migrate () {
43
+ truffle migrate --network development
44
+ [ $? -ne 0 ] && exit 1
45
+ }
46
+
47
+ # Run test cases with truffle
48
+ run_test () {
49
+ truffle test --network development
50
+ [ $? -ne 0 ] && exit 1
51
+ }
52
+
53
+ # Check test coverage
54
+ run_coverage () {
55
+ ./node_modules/.bin/solidity-coverage
56
+ }
You can’t perform that action at this time.
0 commit comments