aboutsummaryrefslogtreecommitdiff
path: root/tests/Makefile
blob: ce009fcdb795c60c6181abe5c550e437fd1db680 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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