summaryrefslogtreecommitdiffstats
path: root/run_tests.fish
diff options
context:
space:
mode:
authorRose Hogenson <rosehogenson@posteo.net>2024-04-07 09:11:28 -0700
committerRose Hogenson <rosehogenson@posteo.net>2024-04-07 09:11:28 -0700
commit278ee46f0fa93a3db4ebdc6878fcd9b1d990094a (patch)
tree85cd7b4703cacea8111ea05766089ca73aac9abb /run_tests.fish
parentbc2fef3a2ab81270af207568706647ced919bbe6 (diff)
downloadsml-278ee46f0fa93a3db4ebdc6878fcd9b1d990094a.tar.zst
Add tests and fix variables.
Diffstat (limited to 'run_tests.fish')
-rw-r--r--run_tests.fish18
1 files changed, 18 insertions, 0 deletions
diff --git a/run_tests.fish b/run_tests.fish
new file mode 100644
index 0000000..f91b8ae
--- /dev/null
+++ b/run_tests.fish
@@ -0,0 +1,18 @@
+#!/usr/bin/env fish
+
+set d (realpath (status dirname))
+
+cd $d/bytecode
+cargo build
+
+cd $d
+
+for f in $d/tests/*.sml
+ $d/bytecode/target/debug/bytecode (sml $d/main.sml -o /dev/stderr $f >/dev/null 2>| psub)
+ set -l got $status
+ if test $got -eq 42
+ echo (basename -s.sml $f): PASS
+ else
+ echo (basename -s.sml $f): FAIL "(status $got)"
+ end
+end