2 include $(TOP
)/config.mak
3 SRC
= $(TOPSRC
)/tests
/tests2
6 # run local version of tcc with local libraries and includes
7 TCCFLAGS
= -B
$(TOP
) -I
$(TOPSRC
)/include
9 TCCFLAGS
= -B
$(TOPSRC
)/win32
-I
$(TOPSRC
)/include -L
$(TOP
)
11 TCC
= $(TOP
)/tcc
$(TCCFLAGS
)
13 TESTS
= $(patsubst %.c
,%.
test,$(sort $(notdir $(wildcard $(SRC
)/*.c
))))
15 # 34_array_assignment.test -- array assignment is not in C standard
16 SKIP
= 34_array_assignment.
test
18 # some tests do not pass on all platforms, remove them for now
19 ifeq ($(CONFIG_arm_eabi
),yes
) # not ARM soft-float
20 SKIP
+= 22_floating_point.
test
22 ifeq ($(TARGETOS
),Darwin
)
28 ifeq (,$(filter i386 x86-64
,$(ARCH
)))
29 SKIP
+= 85-asm-outside-function.
test
32 # Some tests might need arguments
34 31_args.
test : ARGS
= arg1 arg2 arg3 arg4 arg5
35 46_grep.
test : ARGS
= '[^* ]*[:a:d: ]+\:\*-/: $$' $(SRC
)/46_grep.c
37 # Some tests might need different flags
38 76_dollars_in_identifiers.
test : TCCFLAGS
+= -fdollars-in-identifiers
40 # Filter source directory in warnings/errors (out-of-tree builds)
41 FILTER
= 2>&1 | sed
's,$(SRC)/,,g'
42 # Filter some always-warning
43 ifeq (-$(findstring arm
,$(ARCH
))-,-arm-
)
44 FILTER
+= 2>&1 | grep
-v
'warning: soft float ABI currently not supported'
47 all test: $(filter-out $(SKIP
),$(TESTS
))
52 @
$(TCC
) -run
$< $(ARGS
) $(FILTER
) >$*.output
2>&1 || true
53 @diff
-Nbu
$(SRC
)/$*.expect
$*.output
&& rm -f
$*.output
55 # automatically generate .expect files with gcc:
57 (gcc
-w
$*.c
-o a.exe
&& .
/a.exe
$(ARGS
)) >$*.expect
2>&1; rm -f a.exe
59 # tell make not to delete
63 rm -f fred.txt
*.output a.exe