Merge pull request #12259 from ethereum/external-tests-and-scripts-minor-reactors

Tiny refactors in external tests and scripts
This commit is contained in:
chriseth
2021-11-08 17:21:23 +01:00
committed by GitHub
23 changed files with 76 additions and 46 deletions
+2 -2
View File
@@ -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}"
+4 -4
View File
@@ -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"
+3
View File
@@ -18,6 +18,9 @@
#
# (c) 2019 solidity contributors.
#------------------------------------------------------------------------------
set -e
source scripts/common.sh
source test/externalTests/common.sh
+5 -3
View File
@@ -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."
+3
View File
@@ -18,6 +18,9 @@
#
# (c) 2019 solidity contributors.
#------------------------------------------------------------------------------
set -e
source scripts/common.sh
source test/externalTests/common.sh
+3
View File
@@ -18,6 +18,9 @@
#
# (c) 2020 solidity contributors.
#------------------------------------------------------------------------------
set -e
source scripts/common.sh
source test/externalTests/common.sh
+3
View File
@@ -18,6 +18,9 @@
#
# (c) 2019 solidity contributors.
#------------------------------------------------------------------------------
set -e
source scripts/common.sh
source test/externalTests/common.sh
+3
View File
@@ -18,6 +18,9 @@
#
# (c) 2019 solidity contributors.
#------------------------------------------------------------------------------
set -e
source scripts/common.sh
source test/externalTests/common.sh
+3
View File
@@ -18,6 +18,9 @@
#
# (c) 2019 solidity contributors.
#------------------------------------------------------------------------------
set -e
source scripts/common.sh
source test/externalTests/common.sh
+1 -1
View File
@@ -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)