Merge pull request #6186 from ethereum/runExternalTestsWithOptimizer

Run external tests with and without optimizer.
This commit is contained in:
chriseth 2019-03-07 12:57:03 +01:00 committed by GitHub
commit 7241aa755c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -91,10 +91,15 @@ function test_truffle
module.exports['compilers'] = {solc: {version: "$DIR/solc"} };
EOF
npx truffle compile
echo "Verify that the correct version ($SOLCVERSION) of the compiler was used to compile the contracts..."
grep -e "$SOLCVERSION" -r build/contracts > /dev/null
npm run test
for optimize in "{enabled: false }" "{enabled: true }" "{enabled: true, details: { yul: true } }"
do
rm -rf build || true
echo "module.exports['compilers']['solc']['settings'] = {optimizer: $optimize };" >> truffle*.js
npx truffle compile
echo "Verify that the correct version ($SOLCVERSION) of the compiler was used to compile the contracts..."
grep -e "$SOLCVERSION" -r build/contracts > /dev/null
npm run test
done
)
rm -rf "$DIR"
}