aboutsummaryrefslogtreecommitdiff
path: root/tests/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Makefile')
-rw-r--r--tests/Makefile39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/Makefile b/tests/Makefile
new file mode 100644
index 0000000..ce009fc
--- /dev/null
+++ b/tests/Makefile
@@ -0,0 +1,39 @@
+check:
+ $(MAKE) -f scripts/makefile check
+
+.DEFAULT:
+ $(MAKE) -f scripts/makefile $<
+
+TESTS != find . -name test.mk
+DO != echo -n > tests.mk && rm -rf reports
+
+# collect tests that are expected to pass into XPASS, each testcase is assumed
+# to be in a separate directory, let's call it $NAME, and have a $NAME/test.mk
+# file which just appends the $NAME of to XPASS if the test should pass, so
+#
+# XPASS += $NAME
+#
+# or to XFAIL along, with the expected error message with the format
+#
+# XFAIL += $NAME,'error message'
+#
+# Note that it's very important to use single quotes here, otherwise Make might
+# start splitting the error message along spaces into arguments.
+#
+# Each test is assumed to have a fwd file called $NAME/$NAME.fwd, which should
+# exercise some part of the compiler. The test framework links all libraries in
+# `../mod` into the binary automatically. Test logs, along with some other
+# useful stuff, is written out to `reports/$NAME`.
+XPASS :=
+XFAIL :=
+
+include $(TESTS)
+
+DO != ./scripts/gen-xpass $(XPASS)
+DO != ./scripts/gen-xfail $(XFAIL)
+
+RM ?= rm
+
+.PHONY: clean
+clean:
+ $(RM) -rf reports