File tree Expand file tree Collapse file tree 5 files changed +70
-53
lines changed
Expand file tree Collapse file tree 5 files changed +70
-53
lines changed Original file line number Diff line number Diff line change 11module . 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' ,
34 skipFiles : [
45 'contracts/Migrations.sol' ,
56 'contracts/implementation.sol'
Original file line number Diff line number Diff line change 1717 },
1818 "dependencies" : {},
1919 "scripts" : {
20- "coverage" : " ./node_modules/.bin/solidity- coverage" ,
20+ "coverage" : " scripts/ coverage.sh " ,
2121 "build" : " truffle compile" ,
2222 "migrate" : " truffle migrate" ,
2323 "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 11#! /bin/bash
22
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
544check_truffle_project
5+ trap kill_ganache SIGINT SIGTERM SIGTSTP
556run_ganache
567run_test
578kill_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