mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #12259 from ethereum/external-tests-and-scripts-minor-reactors
Tiny refactors in external tests and scripts
This commit is contained in:
@@ -154,7 +154,7 @@ function ask_expectation_update
|
||||
|
||||
# General helper function for testing SOLC behaviour, based on file name, compile opts, exit code, stdout and stderr.
|
||||
# An failure is expected.
|
||||
function test_solc_behaviour()
|
||||
function test_solc_behaviour
|
||||
{
|
||||
local filename="${1}"
|
||||
local solc_args
|
||||
@@ -288,7 +288,7 @@ EOF
|
||||
}
|
||||
|
||||
|
||||
function test_solc_assembly_output()
|
||||
function test_solc_assembly_output
|
||||
{
|
||||
local input="${1}"
|
||||
local expected="${2}"
|
||||
|
||||
@@ -10,11 +10,11 @@ REPO_ROOT=$(cd "$(dirname "$0")/.." && pwd)
|
||||
|
||||
if [ "$CIRCLECI" ]
|
||||
then
|
||||
function printTask() { echo "$(tput bold)$(tput setaf 2)$1$(tput setaf 7)"; }
|
||||
function printError() { echo "$(tput setaf 1)$1$(tput setaf 7)"; }
|
||||
function printTask { echo "$(tput bold)$(tput setaf 2)$1$(tput setaf 7)"; }
|
||||
function printError { echo "$(tput setaf 1)$1$(tput setaf 7)"; }
|
||||
else
|
||||
function printTask() { echo "$(tput bold)$(tput setaf 2)$1$(tput sgr0)"; }
|
||||
function printError() { echo "$(tput setaf 1)$1$(tput sgr0)"; }
|
||||
function printTask { echo "$(tput bold)$(tput setaf 2)$1$(tput sgr0)"; }
|
||||
function printError { echo "$(tput setaf 1)$1$(tput sgr0)"; }
|
||||
fi
|
||||
|
||||
printTask "Checking docs examples style"
|
||||
|
||||
@@ -18,6 +18,9 @@
|
||||
#
|
||||
# (c) 2019 solidity contributors.
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
set -e
|
||||
|
||||
source scripts/common.sh
|
||||
source test/externalTests/common.sh
|
||||
|
||||
|
||||
@@ -187,7 +187,8 @@ function run_test
|
||||
$test_fn
|
||||
}
|
||||
|
||||
function optimizer_settings_for_level {
|
||||
function optimizer_settings_for_level
|
||||
{
|
||||
local level="$1"
|
||||
|
||||
case "$level" in
|
||||
@@ -201,7 +202,8 @@ function optimizer_settings_for_level {
|
||||
esac
|
||||
}
|
||||
|
||||
function truffle_compiler_settings {
|
||||
function truffle_compiler_settings
|
||||
{
|
||||
local solc_path="$1"
|
||||
local level="$2"
|
||||
local evm_version="$3"
|
||||
@@ -251,7 +253,7 @@ function external_test
|
||||
|
||||
printTask "Testing $name..."
|
||||
echo "==========================="
|
||||
DIR=$(mktemp -d)
|
||||
DIR=$(mktemp -d -t "ext-test-${name}-XXXXXX")
|
||||
(
|
||||
if [ -z "$main_fn" ]; then
|
||||
printError "Test main function not defined."
|
||||
|
||||
@@ -18,6 +18,9 @@
|
||||
#
|
||||
# (c) 2019 solidity contributors.
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
set -e
|
||||
|
||||
source scripts/common.sh
|
||||
source test/externalTests/common.sh
|
||||
|
||||
|
||||
@@ -18,6 +18,9 @@
|
||||
#
|
||||
# (c) 2020 solidity contributors.
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
set -e
|
||||
|
||||
source scripts/common.sh
|
||||
source test/externalTests/common.sh
|
||||
|
||||
|
||||
@@ -18,6 +18,9 @@
|
||||
#
|
||||
# (c) 2019 solidity contributors.
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
set -e
|
||||
|
||||
source scripts/common.sh
|
||||
source test/externalTests/common.sh
|
||||
|
||||
|
||||
@@ -18,6 +18,9 @@
|
||||
#
|
||||
# (c) 2019 solidity contributors.
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
set -e
|
||||
|
||||
source scripts/common.sh
|
||||
source test/externalTests/common.sh
|
||||
|
||||
|
||||
@@ -18,6 +18,9 @@
|
||||
#
|
||||
# (c) 2019 solidity contributors.
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
set -e
|
||||
|
||||
source scripts/common.sh
|
||||
source test/externalTests/common.sh
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ FILETMP=$(mktemp -d)
|
||||
cd "$FILETMP" || exit 1
|
||||
|
||||
|
||||
function testFile()
|
||||
function testFile
|
||||
{
|
||||
set +e
|
||||
ALLOUTPUT=$($SOLC --combined-json ast --pretty-json "$@" --stop-after parsing 2>&1)
|
||||
|
||||
Reference in New Issue
Block a user