diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-07-11 05:53:31 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-07-13 23:10:37 +0800 |
commit | 9a5aac599e0003009fd0ba1794c6a02d97b3d026 (patch) | |
tree | 423c04325c16c3da75b51e123eceb87690e190be | |
parent | 32a76f15e058ff02b63e742e7801ede937ed31a2 (diff) | |
download | dexon-solidity-9a5aac599e0003009fd0ba1794c6a02d97b3d026.tar dexon-solidity-9a5aac599e0003009fd0ba1794c6a02d97b3d026.tar.gz dexon-solidity-9a5aac599e0003009fd0ba1794c6a02d97b3d026.tar.bz2 dexon-solidity-9a5aac599e0003009fd0ba1794c6a02d97b3d026.tar.lz dexon-solidity-9a5aac599e0003009fd0ba1794c6a02d97b3d026.tar.xz dexon-solidity-9a5aac599e0003009fd0ba1794c6a02d97b3d026.tar.zst dexon-solidity-9a5aac599e0003009fd0ba1794c6a02d97b3d026.zip |
Run tests on source code from docs
-rwxr-xr-x | test/cmdlineTests.sh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/cmdlineTests.sh b/test/cmdlineTests.sh index 4074ce55..97823515 100755 --- a/test/cmdlineTests.sh +++ b/test/cmdlineTests.sh @@ -49,6 +49,30 @@ do test -z "$output" -a "$failed" -eq 0 done +echo "Compiling all examples from the documentation..." +TMPDIR=$(mktemp -d) +( + set -e + cd "$REPO_ROOT" + REPO_ROOT=$(pwd) # make it absolute + cd "$TMPDIR" + "$REPO_ROOT"/scripts/isolate_tests.py "$REPO_ROOT"/docs/ docs + for f in *.sol + do + echo "trying $f" + set +e + output=$("$SOLC" "$f" 2>&1) + 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 + done +) +rm -rf "$TMPDIR" +echo "Done." + echo "Testing library checksum..." echo '' | "$SOLC" --link --libraries a:0x90f20564390eAe531E810af625A22f51385Cd222 ! echo '' | "$SOLC" --link --libraries a:0x80f20564390eAe531E810af625A22f51385Cd222 2>/dev/null @@ -77,6 +101,7 @@ TMPDIR=$(mktemp -d) REPO_ROOT=$(pwd) # make it absolute cd "$TMPDIR" "$REPO_ROOT"/scripts/isolate_tests.py "$REPO_ROOT"/test/ + "$REPO_ROOT"/scripts/isolate_tests.py "$REPO_ROOT"/docs/ docs for f in *.sol do set +e |