2019-08-14 13:43:24 +00:00
|
|
|
#! /bin/bash
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
# Bash script to execute the Solidity tests by CircleCI.
|
|
|
|
#
|
|
|
|
# The documentation for solidity is hosted at:
|
|
|
|
#
|
2020-11-18 14:20:34 +00:00
|
|
|
# https://docs.soliditylang.org
|
2019-08-14 13:43:24 +00:00
|
|
|
#
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
# This file is part of solidity.
|
|
|
|
#
|
|
|
|
# solidity is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# solidity is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with solidity. If not, see <http://www.gnu.org/licenses/>
|
|
|
|
#
|
|
|
|
# (c) 2016-2019 solidity contributors.
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
set -e
|
|
|
|
|
2020-12-11 17:19:53 +00:00
|
|
|
REPODIR="$(realpath "$(dirname "$0")"/..)"
|
2019-08-14 13:43:24 +00:00
|
|
|
|
2021-10-28 10:32:53 +00:00
|
|
|
# shellcheck source=scripts/common.sh
|
|
|
|
source "${REPODIR}/scripts/common.sh"
|
|
|
|
|
2023-04-09 14:40:09 +00:00
|
|
|
EVM_VALUES=(homestead byzantium constantinople petersburg istanbul berlin london paris shanghai)
|
2023-04-26 11:03:17 +00:00
|
|
|
DEFAULT_EVM=shanghai
|
2021-04-13 07:15:50 +00:00
|
|
|
[[ " ${EVM_VALUES[*]} " =~ $DEFAULT_EVM ]]
|
2020-07-15 11:05:08 +00:00
|
|
|
OPTIMIZE_VALUES=(0 1)
|
2020-09-23 15:33:56 +00:00
|
|
|
|
2021-03-23 11:19:34 +00:00
|
|
|
# Run for ABI encoder v1, without SMTChecker tests.
|
2021-12-20 18:03:48 +00:00
|
|
|
EVM="${DEFAULT_EVM}" \
|
|
|
|
OPTIMIZE=1 \
|
|
|
|
ABI_ENCODER_V1=1 \
|
|
|
|
BOOST_TEST_ARGS="-t !smtCheckerTests" \
|
|
|
|
"${REPODIR}/.circleci/soltest.sh"
|
2020-07-15 11:05:08 +00:00
|
|
|
|
2021-12-20 18:03:48 +00:00
|
|
|
# We shift the batch index so that long-running tests
|
|
|
|
# do not always run in the same executor for all EVM versions
|
|
|
|
INDEX_SHIFT=0
|
2020-12-11 17:19:53 +00:00
|
|
|
for OPTIMIZE in "${OPTIMIZE_VALUES[@]}"
|
2020-07-15 11:05:08 +00:00
|
|
|
do
|
2020-12-11 17:19:53 +00:00
|
|
|
for EVM in "${EVM_VALUES[@]}"
|
2020-07-15 11:05:08 +00:00
|
|
|
do
|
2021-02-12 11:55:36 +00:00
|
|
|
ENFORCE_GAS_ARGS=""
|
2021-04-13 07:15:50 +00:00
|
|
|
[ "${EVM}" = "${DEFAULT_EVM}" ] && ENFORCE_GAS_ARGS="--enforce-gas-cost"
|
2021-03-23 11:19:34 +00:00
|
|
|
# Run SMTChecker tests only when OPTIMIZE == 0
|
|
|
|
DISABLE_SMTCHECKER=""
|
|
|
|
[ "${OPTIMIZE}" != "0" ] && DISABLE_SMTCHECKER="-t !smtCheckerTests"
|
2020-07-22 18:18:33 +00:00
|
|
|
|
2021-12-20 18:03:48 +00:00
|
|
|
EVM="$EVM" \
|
|
|
|
OPTIMIZE="$OPTIMIZE" \
|
2023-01-12 08:08:39 +00:00
|
|
|
SOLTEST_FLAGS="$SOLTEST_FLAGS $ENFORCE_GAS_ARGS" \
|
2021-12-20 18:03:48 +00:00
|
|
|
BOOST_TEST_ARGS="-t !@nooptions $DISABLE_SMTCHECKER" \
|
|
|
|
INDEX_SHIFT="$INDEX_SHIFT" \
|
|
|
|
"${REPODIR}/.circleci/soltest.sh"
|
2020-07-15 11:05:08 +00:00
|
|
|
|
2021-12-20 18:03:48 +00:00
|
|
|
INDEX_SHIFT=$((INDEX_SHIFT + 1))
|
|
|
|
done
|
2023-01-12 08:08:39 +00:00
|
|
|
done
|