diff options
author | Yoichi Hirai <i@yoichihirai.com> | 2017-03-13 23:37:55 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-13 23:37:55 +0800 |
commit | 9aab3b8639afa6e30e866e052a412b6f39c6ef6c (patch) | |
tree | 511895fefe1b4cf33df9359663b6537901c56ddf /test/cmdlineTests.sh | |
parent | ef8b56a05823e39ffc2577af653200f22d6b15a1 (diff) | |
parent | 31a5e5bfef086c1cac477661dd627fa774bc44f5 (diff) | |
download | dexon-solidity-9aab3b8639afa6e30e866e052a412b6f39c6ef6c.tar.gz dexon-solidity-9aab3b8639afa6e30e866e052a412b6f39c6ef6c.tar.zst dexon-solidity-9aab3b8639afa6e30e866e052a412b6f39c6ef6c.zip |
Merge pull request #1768 from ethereum/abortiffileexists
Do not overwrite files unless forced.
Diffstat (limited to 'test/cmdlineTests.sh')
-rwxr-xr-x | test/cmdlineTests.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/cmdlineTests.sh b/test/cmdlineTests.sh index cb714efe..fc04bd7d 100755 --- a/test/cmdlineTests.sh +++ b/test/cmdlineTests.sh @@ -50,9 +50,23 @@ echo "Testing library checksum..." echo '' | "$SOLC" --link --libraries a:0x90f20564390eAe531E810af625A22f51385Cd222 ! echo '' | "$SOLC" --link --libraries a:0x80f20564390eAe531E810af625A22f51385Cd222 2>/dev/null +echo "Testing overwriting files" +TMPDIR=$(mktemp -d) +( + set -e + # First time it works + echo 'contract C {} ' | "$SOLC" --bin -o "$TMPDIR/non-existing-stuff-to-create" 2>/dev/null + # Second time it fails + ! echo 'contract C {} ' | "$SOLC" --bin -o "$TMPDIR/non-existing-stuff-to-create" 2>/dev/null + # Unless we force + echo 'contract C {} ' | "$SOLC" --overwrite --bin -o "$TMPDIR/non-existing-stuff-to-create" 2>/dev/null +) +rm -rf "$TMPDIR" + echo "Testing soljson via the fuzzer..." TMPDIR=$(mktemp -d) ( + set -e cd "$REPO_ROOT" REPO_ROOT=$(pwd) # make it absolute cd "$TMPDIR" |