diff options
author | chriseth <chris@ethereum.org> | 2017-08-25 21:41:41 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2018-02-13 07:26:03 +0800 |
commit | 9956d1dd7b798d122a66ef2155a51c1935b4d122 (patch) | |
tree | 77c3b12e05192c6aa9a96867518236a3fdfb280b | |
parent | 954903b50540456906fd7ba909d7d663e2bd7a7f (diff) | |
download | dexon-solidity-9956d1dd7b798d122a66ef2155a51c1935b4d122.tar.gz dexon-solidity-9956d1dd7b798d122a66ef2155a51c1935b4d122.tar.zst dexon-solidity-9956d1dd7b798d122a66ef2155a51c1935b4d122.zip |
Also test Gnosis contracts.
-rwxr-xr-x | test/externalTests.sh | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/test/externalTests.sh b/test/externalTests.sh index f707d6db..5b889914 100755 --- a/test/externalTests.sh +++ b/test/externalTests.sh @@ -36,21 +36,28 @@ fi SOLJSON="$1" -DIR=$(mktemp -d) -( - echo "Running Zeppelin tests..." - git clone --depth 1 https://github.com/OpenZeppelin/zeppelin-solidity.git "$DIR" - cd "$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" +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 + 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 |