tests: Minor adjustments selecting which tests are run on each platform.
[tinycc/miki.git] / tests2 / Makefile
blobb57028b25d4df8f54ed726bd548a532f81c53eca
1 TOP = ..
2 include $(TOP)/Makefile
4 ifeq ($(TARGETOS),Darwin)
5 CFLAGS+=-Wl,-flat_namespace,-undefined,warning
6 TCCFLAGS=-D_ANSI_SOURCE
7 export MACOSX_DEPLOYMENT_TARGET:=10.2
8 endif
10 ifdef CONFIG_WIN32
11 TCCFLAGS=-I $(TOP)/win32/include -L$(TOP)
12 endif
14 TESTS= 00_assignment.test \
15 01_comment.test \
16 02_printf.test \
17 03_struct.test \
18 04_for.test \
19 05_array.test \
20 06_case.test \
21 07_function.test \
22 08_while.test \
23 09_do_while.test \
24 10_pointer.test \
25 11_precedence.test \
26 12_hashdefine.test \
27 13_integer_literals.test \
28 14_if.test \
29 15_recursion.test \
30 16_nesting.test \
31 17_enum.test \
32 18_include.test \
33 19_pointer_arithmetic.test \
34 20_pointer_comparison.test \
35 21_char_array.test \
36 22_floating_point.test \
37 23_type_coercion.test \
38 24_math_library.test \
39 25_quicksort.test \
40 26_character_constants.test \
41 27_sizeof.test \
42 28_strings.test \
43 29_array_address.test \
44 31_args.test \
45 32_led.test \
46 33_ternary_op.test \
47 35_sizeof.test \
48 36_array_initialisers.test \
49 37_sprintf.test \
50 38_multiple_array_index.test \
51 39_typedef.test \
52 40_stdio.test \
53 41_hashif.test \
54 42_function_pointer.test \
55 43_void_param.test \
56 44_scoped_declarations.test \
57 45_empty_for.test \
58 47_switch_return.test \
59 48_nested_break.test \
60 49_bracket_evaluation.test \
61 50_logical_second_arg.test \
62 51_static.test \
63 52_unnamed_enum.test \
64 54_goto.test
66 # 30_hanoi.test \ # seg fault in the code, gcc as well
67 # 34_array_assignment.test \ # array assignment is not in C standard
68 # 46_grep.test \ # does not compile even with gcc
70 # some tests do not pass on all platforms, remove them for now
71 ifeq ($(TARGETOS),Darwin)
72 TESTS := $(filter-out 40_stdio.test,$(TESTS))
73 endif
74 ifdef CONFIG_WIN32
75 TESTS := $(filter-out 24_math_library.test,$(TESTS))
76 TESTS := $(filter-out 28_strings.test,$(TESTS))
77 endif
79 %.test: %.expect %.c
80 @echo Test: $*...
81 @if [ "x`echo $* | grep args`" != "x" ]; \
82 then \
83 ../tcc -B.. $(TCCFLAGS) -run $*.c - arg1 arg2 arg3 arg4 2>&1 >$*.output; \
84 else \
85 ../tcc -B.. $(TCCFLAGS) -run $*.c 2>&1 >$*.output; \
87 @if diff -bu $*.expect $*.output ; \
88 then \
89 rm -f $*.output \
90 else \
91 echo "ERROR: test $*"; \
94 all: test
96 test: $(TESTS)
98 # vim: set expandtab ts=4 sw=4 sts=4 tw=80 :