Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
openzeppelin-contracts-upgradeable
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
俞永鹏
openzeppelin-contracts-upgradeable
Commits
c991eaf9
Commit
c991eaf9
authored
Jul 21, 2017
by
Francisco Giordano
Committed by
GitHub
Jul 21, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #325 from frangio/refactor/test-script
Refactor test script
parents
c3a30e9b
86a69fd6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
11 deletions
+23
-11
test.sh
scripts/test.sh
+23
-11
No files found.
scripts/test.sh
View file @
c991eaf9
#!
/bin/bash
#!/bin/bash
output
=
$(
nc
-z
localhost 8545
;
echo
$?
)
[
$output
-eq
"0"
]
&&
trpc_running
=
true
if
[
!
$trpc_running
]
;
then
echo
"Starting our own testrpc node instance"
# we give each account 1M ether, needed for high-value tests
# Executes cleanup function at script exit.
trap
cleanup EXIT
cleanup
()
{
# Kill the testrpc instance that we started (if we started one).
if
[
-n
"
$testrpc_pid
"
]
;
then
kill
-9
$testrpc_pid
fi
}
testrpc_running
()
{
nc
-z
localhost 8545
}
if
testrpc_running
;
then
echo
"Using existing testrpc instance"
else
echo
"Starting our own testrpc instance"
# We define 10 accounts with balance 1M ether, needed for high-value tests.
testrpc
\
--account
=
"0x2bdd21761a483f71054e14f5b827213567971c676928d9a1808cbfa4b7501200,1000000000000000000000000"
\
--account
=
"0x2bdd21761a483f71054e14f5b827213567971c676928d9a1808cbfa4b7501201,1000000000000000000000000"
\
...
...
@@ -17,9 +31,7 @@ if [ ! $trpc_running ]; then
--account
=
"0x2bdd21761a483f71054e14f5b827213567971c676928d9a1808cbfa4b7501208,1000000000000000000000000"
\
--account
=
"0x2bdd21761a483f71054e14f5b827213567971c676928d9a1808cbfa4b7501209,1000000000000000000000000"
\
>
/dev/null &
trpc_pid
=
$!
fi
./node_modules/truffle/cli.js
test
"
$@
"
if
[
!
$trpc_running
]
;
then
kill
-9
$trpc_pid
testrpc_pid
=
$!
fi
node_modules/.bin/truffle
test
"
$@
"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment