diff --git a/test/externalTests/colony.sh b/test/externalTests/colony.sh index 91a82d8bb..349cabf2a 100755 --- a/test/externalTests/colony.sh +++ b/test/externalTests/colony.sh @@ -33,15 +33,15 @@ function colony_test OPTIMIZER_LEVEL=3 CONFIG="truffle.js" - truffle_setup https://github.com/solidity-external-tests/colonyNetwork.git develop_070 - run_install install_fn + truffle_setup "$SOLJSON" https://github.com/solidity-external-tests/colonyNetwork.git develop_070 + run_install "$SOLJSON" install_fn cd lib rm -Rf dappsys git clone https://github.com/solidity-external-tests/dappsys-monolithic.git -b master_060 dappsys cd .. - truffle_run_test compile_fn test_fn "NO-FORCE-ABI-V2" + truffle_run_test "$SOLJSON" compile_fn test_fn "NO-FORCE-ABI-V2" } external_test ColonyNetworks colony_test diff --git a/test/externalTests/common.sh b/test/externalTests/common.sh index 6e4924762..ad36a5ff4 100644 --- a/test/externalTests/common.sh +++ b/test/externalTests/common.sh @@ -40,9 +40,10 @@ function verify_version_input function setup { - local branch="$1" + local soljson="$1" + local branch="$2" - setup_solcjs "$DIR" "$SOLJSON" "$branch" "solc" + setup_solcjs "$DIR" "$soljson" "$branch" "solc" cd solc } @@ -92,10 +93,11 @@ function force_truffle_version function truffle_setup { - local repo="$1" - local branch="$2" + local soljson="$1" + local repo="$2" + local branch="$3" - setup_solcjs "$DIR" "$SOLJSON" "master" "solc" + setup_solcjs "$DIR" "$soljson" "master" "solc" download_project "$repo" "$branch" "$DIR" } @@ -207,11 +209,12 @@ function clean function run_install { - local init_fn="$1" + local soljson="$1" + local init_fn="$2" printLog "Running install function..." replace_version_pragmas - force_solc "$CONFIG" "$DIR" "$SOLJSON" + force_solc "$CONFIG" "$DIR" "$soljson" $init_fn } @@ -232,14 +235,15 @@ function run_test function truffle_run_test { - local compile_fn="$1" - local test_fn="$2" - local force_abi_v2_flag="$3" + local soljson="$1" + local compile_fn="$2" + local test_fn="$3" + local force_abi_v2_flag="$4" test "$force_abi_v2_flag" = "FORCE-ABI-V2" || test "$force_abi_v2_flag" = "NO-FORCE-ABI-V2" replace_version_pragmas - force_solc "$CONFIG" "$DIR" "$SOLJSON" + force_solc "$CONFIG" "$DIR" "$soljson" printLog "Checking optimizer level..." if [ -z "$OPTIMIZER_LEVEL" ]; then diff --git a/test/externalTests/ens.sh b/test/externalTests/ens.sh index d67f1fe77..40432198f 100755 --- a/test/externalTests/ens.sh +++ b/test/externalTests/ens.sh @@ -35,14 +35,14 @@ function ens_test export OPTIMIZER_LEVEL=1 export CONFIG="truffle-config.js" - truffle_setup https://github.com/solidity-external-tests/ens.git upgrade-0.8.0 + truffle_setup "$SOLJSON" https://github.com/solidity-external-tests/ens.git upgrade-0.8.0 # Use latest Truffle. Older versions crash on the output from 0.8.0. force_truffle_version ^5.1.55 - run_install install_fn + run_install "$SOLJSON" install_fn - truffle_run_test compile_fn test_fn "NO-FORCE-ABI-V2" + truffle_run_test "$SOLJSON" compile_fn test_fn "NO-FORCE-ABI-V2" } external_test Ens ens_test diff --git a/test/externalTests/gnosis.sh b/test/externalTests/gnosis.sh index 83a8cd499..73870f8db 100755 --- a/test/externalTests/gnosis.sh +++ b/test/externalTests/gnosis.sh @@ -33,17 +33,17 @@ function gnosis_safe_test OPTIMIZER_LEVEL=1 CONFIG="truffle.js" - truffle_setup https://github.com/solidity-external-tests/safe-contracts.git development_070 + truffle_setup "$SOLJSON" https://github.com/solidity-external-tests/safe-contracts.git development_070 force_truffle_version ^5.0.42 sed -i 's|github:gnosis/mock-contract#sol_0_5_0|github:solidity-external-tests/mock-contract#master_070|g' package.json rm -f package-lock.json rm -rf node_modules/ - run_install install_fn + run_install "$SOLJSON" install_fn replace_libsolc_call - truffle_run_test compile_fn test_fn "NO-FORCE-ABI-V2" + truffle_run_test "$SOLJSON" compile_fn test_fn "NO-FORCE-ABI-V2" } external_test Gnosis-Safe gnosis_safe_test diff --git a/test/externalTests/solc-js/solc-js.sh b/test/externalTests/solc-js/solc-js.sh index fd59c4398..9cc753959 100755 --- a/test/externalTests/solc-js/solc-js.sh +++ b/test/externalTests/solc-js/solc-js.sh @@ -35,7 +35,7 @@ function solcjs_test SOLCJS_INPUT_DIR="$TEST_DIR"/test/externalTests/solc-js # set up solc-js on the branch specified - setup master + setup "$SOLJSON" master printLog "Updating index.js file..." echo "require('./determinism.js');" >> test/index.js diff --git a/test/externalTests/zeppelin.sh b/test/externalTests/zeppelin.sh index 35e47faba..e71e974d6 100755 --- a/test/externalTests/zeppelin.sh +++ b/test/externalTests/zeppelin.sh @@ -33,10 +33,10 @@ function zeppelin_test OPTIMIZER_LEVEL=1 CONFIG="truffle-config.js" - truffle_setup https://github.com/solidity-external-tests/openzeppelin-contracts.git upgrade-0.7.0 - run_install install_fn + truffle_setup "$SOLJSON" https://github.com/solidity-external-tests/openzeppelin-contracts.git upgrade-0.7.0 + run_install "$SOLJSON" install_fn - truffle_run_test compile_fn test_fn "NO-FORCE-ABI-V2" + truffle_run_test "$SOLJSON" compile_fn test_fn "NO-FORCE-ABI-V2" } external_test Zeppelin zeppelin_test