Also test Gnosis contracts.

This commit is contained in:
chriseth 2017-08-25 15:41:41 +02:00 committed by Alex Beregszaszi
parent 954903b505
commit 9956d1dd7b

View File

@ -36,21 +36,28 @@ fi
SOLJSON="$1" SOLJSON="$1"
DIR=$(mktemp -d) function test_truffle
( {
echo "Running Zeppelin tests..." name="$1"
git clone --depth 1 https://github.com/OpenZeppelin/zeppelin-solidity.git "$DIR" repo="$2"
echo "Running $name tests..."
DIR=$(mktemp -d)
(
git clone --depth 1 "$repo" "$DIR"
cd "$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) # 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? # 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/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/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 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 install
find . -name soljson.js -exec cp "$SOLJSON" {} \;
npm run test npm run test
) )
rm -rf "$DIR" rm -rf "$DIR"
}
test_truffle Gnosis https://github.com/gnosis/gnosis-contracts.git
test_truffle Zeppelin https://github.com/OpenZeppelin/zeppelin-solidity.git