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
c79c6d76
Commit
c79c6d76
authored
Aug 14, 2017
by
Francisco Giordano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unify test and coverage scripts
parent
6e66ba32
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
38 deletions
+29
-38
coverage.sh
scripts/coverage.sh
+2
-36
test.sh
scripts/test.sh
+27
-2
No files found.
scripts/coverage.sh
View file @
c79c6d76
#!/
bin/
bash
#!/
usr/bin/env
bash
# 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 8555
}
if
testrpc_running
;
then
echo
"Using existing testrpc-sc instance"
else
echo
"Starting testrpc-sc to generate coverage"
# We define 10 accounts with balance 1M ether, needed for high-value tests.
./node_modules/ethereumjs-testrpc-sc/build/cli.node.js
--gasLimit
0xfffffffffff
--port
8555
\
--account
=
"0x2bdd21761a483f71054e14f5b827213567971c676928d9a1808cbfa4b7501200,1000000000000000000000000"
\
--account
=
"0x2bdd21761a483f71054e14f5b827213567971c676928d9a1808cbfa4b7501201,1000000000000000000000000"
\
--account
=
"0x2bdd21761a483f71054e14f5b827213567971c676928d9a1808cbfa4b7501202,1000000000000000000000000"
\
--account
=
"0x2bdd21761a483f71054e14f5b827213567971c676928d9a1808cbfa4b7501203,1000000000000000000000000"
\
--account
=
"0x2bdd21761a483f71054e14f5b827213567971c676928d9a1808cbfa4b7501204,1000000000000000000000000"
\
--account
=
"0x2bdd21761a483f71054e14f5b827213567971c676928d9a1808cbfa4b7501205,1000000000000000000000000"
\
--account
=
"0x2bdd21761a483f71054e14f5b827213567971c676928d9a1808cbfa4b7501206,1000000000000000000000000"
\
--account
=
"0x2bdd21761a483f71054e14f5b827213567971c676928d9a1808cbfa4b7501207,1000000000000000000000000"
\
--account
=
"0x2bdd21761a483f71054e14f5b827213567971c676928d9a1808cbfa4b7501208,1000000000000000000000000"
\
--account
=
"0x2bdd21761a483f71054e14f5b827213567971c676928d9a1808cbfa4b7501209,1000000000000000000000000"
\
>
/dev/null &
testrpc_pid
=
$!
fi
SOLIDITY_COVERAGE
=
true
./node_modules/.bin/solidity-coverage
SOLIDITY_COVERAGE
=
true
scripts/test.sh
scripts/test.sh
View file @
c79c6d76
#!/usr/bin/env bash
# Exit script as soon as a command fails.
set
-o
errexit
# Executes cleanup function at script exit.
trap
cleanup EXIT
...
...
@@ -10,8 +13,22 @@ cleanup() {
fi
}
if
[
"
$SOLIDITY_COVERAGE
"
=
true
]
;
then
testrpc_port
=
8555
else
testrpc_port
=
8545
fi
testrpc_running
()
{
nc
-z
localhost 8545
nc
-z
localhost
"
$testrpc_port
"
}
testrpc
()
{
if
[
"
$SOLIDITY_COVERAGE
"
=
true
]
;
then
node_modules/.bin/testrpc-sc
--gasLimit
0xfffffffffff
--port
"
$testrpc_port
"
"
$@
"
else
node_modules/.bin/testrpc
"
$@
"
fi
}
if
testrpc_running
;
then
...
...
@@ -34,4 +51,12 @@ else
testrpc_pid
=
$!
fi
node_modules/.bin/truffle
test
"
$@
"
if
[
"
$SOLIDITY_COVERAGE
"
=
true
]
;
then
node_modules/.bin/solidity-coverage
if
[
"
$CONTINUOUS_INTEGRATION
"
=
true
]
;
then
cat
coverage/lcov.info | node_modules/.bin/coveralls
fi
else
node_modules/.bin/truffle
test
"
$@
"
fi
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