aboutsummaryrefslogtreecommitdiff
path: root/compiler/Makefile
diff options
context:
space:
mode:
authorDrahflow <drahflow@gmx.de>2013-01-19 13:35:47 +0100
committerDrahflow <drahflow@gmx.de>2013-01-19 13:35:47 +0100
commitf630deeb77bbfab3d262a172696621ff840dc621 (patch)
tree311ded1ae7dc912e24a4d26bdf46e0105f293fc9 /compiler/Makefile
parentb7a44c57268d42b1abb40b0faea1bd2cc071894f (diff)
loop now working
Diffstat (limited to 'compiler/Makefile')
-rw-r--r--compiler/Makefile33
1 files changed, 33 insertions, 0 deletions
diff --git a/compiler/Makefile b/compiler/Makefile
new file mode 100644
index 0000000..674cc52
--- /dev/null
+++ b/compiler/Makefile
@@ -0,0 +1,33 @@
+.PHONY: test
+
+CASES=../examples/working-compiler
+EXE=../../compiler/elymas.ey
+
+test:
+ for f in $$(ls $(CASES)/*.test | sed -e 's/.*\///g'); do \
+ printf "%20s: " $$f; \
+ echo Input | ( cd $(CASES); $(EXE) "$$f"; echo ) \
+ 2> "test/$$f.err.test" | sed -e 's/.*://g' > "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 $(CASES)/*.test | sed -e 's/.*\///g'); do \
+ echo $$f; \
+ echo Input | ( cd $(CASES); $(EXE) "$$f"; echo ) \
+ 2> "test/$$f.err.correct" | sed -e 's/.*://g' | tee "test/$$f.correct"; \
+ sleep 1; \
+ done
+
+generate-test-fast:
+ mkdir -p test
+ for f in $$(ls $(CASES)/*.test | sed -e 's/.*\///g'); do \
+ echo $$f; \
+ echo Input | ( cd $(CASES); $(EXE) "$$f"; echo ) \
+ 2> "test/$$f.err.correct" | sed -e 's/.*://g' | tee "test/$$f.correct"; \
+ done