diff options
author | Federico Bond <federicobond@gmail.com> | 2017-07-20 03:27:05 +0800 |
---|---|---|
committer | Federico Bond <federicobond@gmail.com> | 2017-10-06 02:21:16 +0800 |
commit | eea88f33aac58e358e3b95ffcf59fd3e89967b81 (patch) | |
tree | 4081d0eb8f460e0f992c1fbde9109bba93b8acec /test/cmdlineTests.sh | |
parent | cd420dc0bcf35117c34c287e7d258ff1ffd59714 (diff) | |
download | dexon-solidity-eea88f33aac58e358e3b95ffcf59fd3e89967b81.tar dexon-solidity-eea88f33aac58e358e3b95ffcf59fd3e89967b81.tar.gz dexon-solidity-eea88f33aac58e358e3b95ffcf59fd3e89967b81.tar.bz2 dexon-solidity-eea88f33aac58e358e3b95ffcf59fd3e89967b81.tar.lz dexon-solidity-eea88f33aac58e358e3b95ffcf59fd3e89967b81.tar.xz dexon-solidity-eea88f33aac58e358e3b95ffcf59fd3e89967b81.tar.zst dexon-solidity-eea88f33aac58e358e3b95ffcf59fd3e89967b81.zip |
Use local variables inside bash functions
Diffstat (limited to 'test/cmdlineTests.sh')
-rwxr-xr-x | test/cmdlineTests.sh | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/test/cmdlineTests.sh b/test/cmdlineTests.sh index 67018941..d50360b2 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 } |