bug:
[tinycc.git] / tests / tests2 / Makefile
blob64532a1b3f388e6e6e55620ce209910ae9e3b092
1 TOP = ../..
2 include $(TOP)/Makefile
4 ifdef CONFIG_WIN32
5 TCCFLAGS = -B$(top_srcdir)/win32 -I$(top_srcdir)/include -L$(TOP)
6 else
7 TCCFLAGS = -B$(TOP) -I$(top_srcdir)/include -lm
8 endif
10 ifeq ($(TARGETOS),Darwin)
11 CFLAGS += -Wl,-flat_namespace,-undefined,warning
12 TCCFLAGS += -D_ANSI_SOURCE
13 export MACOSX_DEPLOYMENT_TARGET:=10.2
14 endif
16 TCC = $(TOP)/tcc $(TCCFLAGS)
18 TESTS = \
19 00_assignment.test \
20 01_comment.test \
21 02_printf.test \
22 03_struct.test \
23 04_for.test \
24 05_array.test \
25 06_case.test \
26 07_function.test \
27 08_while.test \
28 09_do_while.test \
29 10_pointer.test \
30 11_precedence.test \
31 12_hashdefine.test \
32 13_integer_literals.test \
33 14_if.test \
34 15_recursion.test \
35 16_nesting.test \
36 17_enum.test \
37 18_include.test \
38 19_pointer_arithmetic.test \
39 20_pointer_comparison.test \
40 21_char_array.test \
41 22_floating_point.test \
42 23_type_coercion.test \
43 24_math_library.test \
44 25_quicksort.test \
45 26_character_constants.test \
46 27_sizeof.test \
47 28_strings.test \
48 29_array_address.test \
49 30_hanoi.test \
50 31_args.test \
51 32_led.test \
52 33_ternary_op.test \
53 34_array_assignment.test \
54 35_sizeof.test \
55 36_array_initialisers.test \
56 37_sprintf.test \
57 38_multiple_array_index.test \
58 39_typedef.test \
59 40_stdio.test \
60 41_hashif.test \
61 42_function_pointer.test \
62 43_void_param.test \
63 44_scoped_declarations.test \
64 45_empty_for.test \
65 46_grep.test \
66 47_switch_return.test \
67 48_nested_break.test \
68 49_bracket_evaluation.test \
69 50_logical_second_arg.test \
70 51_static.test \
71 52_unnamed_enum.test \
72 54_goto.test \
73 55_lshift_type.test \
74 56_btype_excess-1.test \
75 57_btype_excess-2.test \
76 58_function_redefinition.test \
77 59_function_array.test \
78 60_enum_redefinition.test \
79 61_undefined_enum.test \
80 62_enumerator_redefinition.test \
81 63_local_enumerator_redefinition.test \
82 64_macro_nesting.test \
83 65_macro_concat_start.test \
84 66_macro_concat_end.test \
85 67_macro_concat.test \
86 68_macro_concat.test \
87 69_macro_concat.test
89 # 34_array_assignment.test -- array assignment is not in C standard
91 SKIP = 34_array_assignment.test
93 # some tests do not pass on all platforms, remove them for now
94 ifeq ($(TARGETOS),Darwin)
95 SKIP += 40_stdio.test
96 endif
97 ifdef CONFIG_WIN32
98 SKIP += 24_math_library.test # don't have round()
99 SKIP += 28_strings.test # don't have r/index() / strings.h
100 endif
102 # Some tests might need arguments
103 ARGS =
104 31_args.test : ARGS = arg1 arg2 arg3 arg4 arg5
105 46_grep.test : ARGS = '[^* ]*[:a:d: ]+\:\*-/: $$' 46_grep.c
107 all test: $(filter-out $(SKIP),$(TESTS))
109 %.test: %.c %.expect
110 @echo Test: $*...
112 @$(TCC) -run $< $(ARGS) >$*.output 2>&1 || true
113 @diff -bu $*.expect $*.output && rm -f $*.output
115 @($(TCC) $< -o $*.exe && ./$*.exe $(ARGS)) >$*.output2 2>&1 || true
116 @diff -bu $*.expect $*.output2 && rm -f $*.output2 $*.exe
118 clean:
119 rm -vf fred.txt *.output* *.exe