aboutsummaryrefslogtreecommitdiff
path: root/interpreter
diff options
context:
space:
mode:
Diffstat (limited to 'interpreter')
-rw-r--r--interpreter/Makefile22
1 files changed, 22 insertions, 0 deletions
diff --git a/interpreter/Makefile b/interpreter/Makefile
new file mode 100644
index 0000000..278a9b0
--- /dev/null
+++ b/interpreter/Makefile
@@ -0,0 +1,22 @@
+.PHONY: test
+
+test:
+ for f in $$(ls ../examples/working); do \
+ printf "%20s: " $$f; \
+ echo Input | ( cd ../examples/working; ../../interpreter/elymas "$$f"; echo ) \
+ 2> "test/$$f.err.test" > "test/$$f.test"; \
+ if diff "test/$$f.test" "test/$$f.correct" && diff "test/$$f.err.test" "test/$$f.err.correct"; then \
+ echo "Success."; \
+ else \
+ echo "Failed."; \
+ fi \
+ done
+
+generate-test:
+ mkdir -p test
+ for f in $$(ls ../examples/working); do \
+ echo $$f; \
+ echo Input | ( cd ../examples/working; ../../interpreter/elymas "$$f"; echo ) \
+ 2> "test/$$f.err.correct" | tee "test/$$f.correct"; \
+ sleep 1; \
+ done