Skip to content

Commit

Permalink
Use local variables inside bash functions
Browse files Browse the repository at this point in the history
  • Loading branch information
federicobond committed Oct 5, 2017
1 parent cd420dc commit eea88f3
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions test/cmdlineTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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:"
Expand All @@ -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
}

Expand Down

0 comments on commit eea88f3

Please sign in to comment.