diff options
author | chriseth <chris@ethereum.org> | 2018-02-13 15:38:55 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-13 15:38:55 +0800 |
commit | a75d4ec60e0512197caa8a21996c45850d99091f (patch) | |
tree | 04a96be096c2e9a277b6c76a2f0477dde453ca99 | |
parent | 27ef979458226a7e5a89588c7c3c57b516bad304 (diff) | |
parent | 4876842f69e9d59d102f8f26f4bb2f1fc37b4d36 (diff) | |
download | dexon-solidity-a75d4ec60e0512197caa8a21996c45850d99091f.tar.gz dexon-solidity-a75d4ec60e0512197caa8a21996c45850d99091f.tar.zst dexon-solidity-a75d4ec60e0512197caa8a21996c45850d99091f.zip |
Merge pull request #2818 from ethereum/testGnosis
Also test gnosis contracts.
-rw-r--r-- | .travis.yml | 6 | ||||
-rw-r--r-- | circle.yml | 2 | ||||
-rwxr-xr-x | test/externalTests.sh | 45 |
3 files changed, 32 insertions, 21 deletions
diff --git a/.travis.yml b/.travis.yml index 708d3620..ebe91939 100644 --- a/.travis.yml +++ b/.travis.yml @@ -97,12 +97,12 @@ matrix: sudo: required compiler: gcc node_js: - - "6" + - "7" services: - docker before_install: - - nvm install 6 - - nvm use 6 + - nvm install 7 + - nvm use 7 - docker pull trzeci/emscripten:sdk-tag-1.35.4-64bit env: - SOLC_EMSCRIPTEN=On @@ -76,7 +76,7 @@ jobs: export NVM_DIR="/usr/local/nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm nvm --version - nvm install 6 + nvm install 7 node --version npm --version - run: diff --git a/test/externalTests.sh b/test/externalTests.sh index f707d6db..2a5ff7ef 100755 --- a/test/externalTests.sh +++ b/test/externalTests.sh @@ -36,21 +36,32 @@ fi SOLJSON="$1" -DIR=$(mktemp -d) -( - echo "Running Zeppelin tests..." - git clone --depth 1 https://github.com/OpenZeppelin/zeppelin-solidity.git "$DIR" - cd "$DIR" +function test_truffle +{ + name="$1" + repo="$2" + echo "Running $name tests..." + DIR=$(mktemp -d) + ( + git clone --depth 1 "$repo" "$DIR" + cd "$DIR" + npm install + find . -name soljson.js -exec cp "$SOLJSON" {} \; + if [ "$name" == "Zeppelin" ]; then + # Fix some things that look like bugs (only seemed to fail on Node 6 and not Node 8) + # FIXME: report upstream or to web3.js? + sed -i -e 's/let token = await ERC827TokenMock.new();//;' test/token/ERC827/ERC827Token.js + sed -i -e 's/CappedCrowdsale.new(this.startTime, this.endTime, rate, wallet, 0)/CappedCrowdsale.new(this.startTime, this.endTime, rate, wallet, 0, this.token.address)/' test/crowdsale/CappedCrowdsale.test.js + sed -i -e 's/RefundableCrowdsale.new(this.startTime, this.endTime, rate, wallet, 0, { from: owner })/RefundableCrowdsale.new(this.startTime, this.endTime, rate, wallet, 0, this.token.address, { from: owner })/' test/crowdsale/RefundableCrowdsale.test.js + fi + if [ "$name" == "Gnosis" ]; then + # Replace fixed-version pragmas in Gnosis (part of Consensys best practice) + find contracts test -name '*.sol' -type f -print0 | xargs -0 sed -i -e 's/pragma solidity 0/pragma solidity ^0/' + fi + npm run test + ) + rm -rf "$DIR" +} - # Fix some things that look like bugs (only seemed to fail on Node 6 and not Node 8) - # FIXME: report upstream or to web3.js? - sed -i -e 's/let token = await ERC827TokenMock.new();//;' test/token/ERC827/ERC827Token.js - sed -i -e 's/CappedCrowdsale.new(this.startTime, this.endTime, rate, wallet, 0)/CappedCrowdsale.new(this.startTime, this.endTime, rate, wallet, 0, this.token.address)/' test/crowdsale/CappedCrowdsale.test.js - sed -i -e 's/RefundableCrowdsale.new(this.startTime, this.endTime, rate, wallet, 0, { from: owner })/RefundableCrowdsale.new(this.startTime, this.endTime, rate, wallet, 0, this.token.address, { from: owner })/' test/crowdsale/RefundableCrowdsale.test.js - - npm install - find . -name soljson.js -exec cp "$SOLJSON" {} \; - - npm run test -) -rm -rf "$DIR" +test_truffle Gnosis https://github.com/gnosis/gnosis-contracts.git +test_truffle Zeppelin https://github.com/OpenZeppelin/zeppelin-solidity.git |