aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/tests.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/tests.sh')
-rwxr-xr-xscripts/tests.sh18
1 files changed, 16 insertions, 2 deletions
diff --git a/scripts/tests.sh b/scripts/tests.sh
index 93afd2d2..5da427d4 100755
--- a/scripts/tests.sh
+++ b/scripts/tests.sh
@@ -28,8 +28,22 @@
set -e
-# There is an implicit assumption here that we HAVE to run from root directory.
-REPO_ROOT=$(pwd)
+REPO_ROOT="$(dirname "$0")"/..
+
+ # Compile all files in std and examples.
+
+for f in "$REPO_ROOT"/std/*.sol
+do
+ echo "Compiling $f..."
+ set +e
+ output=$("$REPO_ROOT"/build/solc/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
# This conditional is only needed because we don't have a working Homebrew
# install for `eth` at the time of writing, so we unzip the ZIP file locally