From 7790e27b3423901e2080bfd3c600a65a48d42886 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Fri, 1 May 2026 18:37:38 +0300 Subject: start adding proper tests --- tests/Makefile | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 tests/Makefile (limited to 'tests/Makefile') 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 -- cgit v1.2.3