From eea88f33aac58e358e3b95ffcf59fd3e89967b81 Mon Sep 17 00:00:00 2001 From: Federico Bond Date: Wed, 19 Jul 2017 16:27:05 -0300 Subject: [PATCH] Use local variables inside bash functions --- test/cmdlineTests.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/test/cmdlineTests.sh b/test/cmdlineTests.sh index 67018941f..d50360b23 100755 --- a/test/cmdlineTests.sh +++ b/test/cmdlineTests.sh @@ -43,11 +43,13 @@ test "${output//[[:blank:]]/}" = "3" function compileFull() { - files="$*" + local files="$*" + set +e - output=$( ("$SOLC" $FULLARGS $files) 2>&1 ) - failed=$? + local output=$( ("$SOLC" $FULLARGS $files) 2>&1 ) + local failed=$? set -e + if [ $failed -ne 0 ] then echo "Compilation failed on:" @@ -58,14 +60,16 @@ function compileFull() function compileWithoutWarning() { - files="$*" + local files="$*" + set +e - output=$("$SOLC" $files 2>&1) - failed=$? + local output=$("$SOLC" $files 2>&1) + local failed=$? # Remove the pre-release warning from the compiler output output=$(echo "$output" | grep -v 'pre-release') echo "$output" set -e + test -z "$output" -a "$failed" -eq 0 }