summaryrefslogtreecommitdiff
path: root/test/run-lang-tests.sh
diff options
context:
space:
mode:
authorDavid Phillips <david@sighup.nz>2018-08-01 21:55:36 +1200
committerDavid Phillips <david@sighup.nz>2018-08-01 21:55:40 +1200
commite22abc4eaf4f1446c6ac31e4b709cb5206d4fe3b (patch)
tree60c923bcf3b259f5480c820689d34ad3ff175abf /test/run-lang-tests.sh
parenteff2535b82ff36dda815ef57c385d7767692c3a5 (diff)
downloadhence-e22abc4eaf4f1446c6ac31e4b709cb5206d4fe3b.tar.xz
Add simple language test cases, fix empty line bug
Diffstat (limited to 'test/run-lang-tests.sh')
-rwxr-xr-xtest/run-lang-tests.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/run-lang-tests.sh b/test/run-lang-tests.sh
new file mode 100755
index 0000000..5cc68b3
--- /dev/null
+++ b/test/run-lang-tests.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+cd "$(dirname $0)"
+EXECUTABLE="$PWD/../simulator"
+
+echo $PWD
+
+for src in invalid-hence/*.hence ; do
+ outfile="$(mktemp)"
+ "$EXECUTABLE" "$src" 2> "$outfile"
+ if diff "$src.expected" "$outfile" ; then
+ echo -ne '[\e[0;32mPASS\e[0m]'
+ rm "$outfile"
+ else
+ echo -ne '[\e[1;31mFAIL\e[0m]'
+ fi
+ echo " $src"
+done
+
+#for src in valid-hence/*.hence ; do
+# outfile="$(mktemp)"
+# "$EXECUTABLE" "$src" > "$outfile"
+# if diff "$src.expected" "$outfile" >/dev/null ; then
+# echo "$src: PASS"
+# else
+# echo "$src: FAIL"
+# fi
+#done