Make scripts fail on non-zero return codes and undefined variables where possible

This commit is contained in:
Kamil Śliwak 2020-12-11 20:08:45 +01:00
parent 75b87d159d
commit d14c4288ec
7 changed files with 18 additions and 13 deletions

View File

@ -1,5 +1,7 @@
#!/usr/bin/env bash
set -eu
ERROR_LOG="$(mktemp -t check_style_XXXXXX.log)"
EXCLUDE_FILES=(
@ -20,7 +22,7 @@ REPO_ROOT="$(dirname "$0")"/..
cd "$REPO_ROOT" || exit 1
WHITESPACE=$(git grep -n -I -E "^.*[[:space:]]+$" |
grep -v "test/libsolidity/ASTJSON\|test/libsolidity/ASTRecoveryTests\|test/compilationTests/zeppelin/LICENSE\|${EXCLUDE_FILES_JOINED}"
grep -v "test/libsolidity/ASTJSON\|test/libsolidity/ASTRecoveryTests\|test/compilationTests/zeppelin/LICENSE\|${EXCLUDE_FILES_JOINED}" || true
)
if [[ "$WHITESPACE" != "" ]]
@ -49,7 +51,7 @@ FORMATERROR=$(
preparedGrep "[a-zA-Z0-9_]\s*[&][a-zA-Z_]" | grep -E -v "return [&]" # right-aligned reference ampersand (needs to exclude return)
# right-aligned reference pointer star (needs to exclude return and comments)
preparedGrep "[a-zA-Z0-9_]\s*[*][a-zA-Z_]" | grep -E -v -e "return [*]" -e "^* [*]" -e "^*//.*"
) | grep -E -v -e "^[a-zA-Z\./]*:[0-9]*:\s*\/(\/|\*)" -e "^test/"
) | grep -E -v -e "^[a-zA-Z\./]*:[0-9]*:\s*\/(\/|\*)" -e "^test/" || true
)
if [[ "$FORMATERROR" != "" ]]

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash
set -e
set -eu
REPO_ROOT="$(dirname "$0")"/../..
REPO_ROOT=$(realpath "${REPO_ROOT}")

View File

@ -1,24 +1,25 @@
#!/usr/bin/env bash
set -eu
BASE_PATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 || exit ; pwd -P )"
BASE_PATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 && pwd -P )"
mkdir -p build
cd build || exit
cd build
cmake ../../../
make soltest
cd test/ || exit
cd test/
echo "running soltest on 'semanticTests/extracted'..."
./soltest --color_output=false --log_level=test_suite -t semanticTests/extracted/ -- --testpath "${BASE_PATH}/../../test" --no-smt --evmonepath /Users/alex/evmone/lib/libevmone.dylib --show-messages --show-metadata > "${BASE_PATH}/extracted-tests.trace"
echo "running soltest on 'semanticTests/extracted'... done"
cd "$BASE_PATH" || exit
cd "$BASE_PATH"
git clone git@github.com:ethereum/solidity.git solidity-develop
cd solidity-develop || exit
cd solidity-develop
mkdir -p build
cd build || exit
cd build
cmake ..
make soltest
cd test/ || exit
cd test/
echo "running soltest on 'SolidityEndToEndTest'..."
./soltest --color_output=false --log_level=test_suite -t SolidityEndToEndTest/ -- --testpath "${BASE_PATH}/solidity-develop/test" --no-smt --evmonepath /Users/alex/evmone/lib/libevmone.dylib --show-messages --show-metadata > "${BASE_PATH}/endToEndExtraction-tests.trace"
echo "running soltest on 'SolidityEndToEndTest'... done"

View File

@ -4,7 +4,7 @@
# (the cmake executable will be in ~/.local/bin).
# This is mostly suitable for CIs, not end users.
set -e
set -eu
VERSION_MAJOR=3
VERSION_MINOR=15

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -e
set -eu
TEMPDIR=$(mktemp -d)
(

View File

@ -1,5 +1,7 @@
#!/usr/bin/env bash
set -eu
git clone --depth 1 --branch z3-4.8.7 https://github.com/Z3Prover/z3.git
cd z3
mkdir build

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -e
set -eu
REPO_ROOT="$(dirname "$0")"/..
USE_DEBUGGER=0