tests: Added numerous tests.
[tinycc/miki.git] / tests2 / Makefile
blobcc13cded892b75744372f4a14f46e911b4f39a14
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 %.test: %.expect %.c
71 @echo Test: $*...
72 -@if [ "x`echo $* | grep args`" != "x" ]; \
73 then \
74 ../tcc -B.. $(TCCFLAGS) -run $*.c - arg1 arg2 arg3 arg4 2>&1 >$*.output; \
75 else \
76 ../tcc -B.. $(TCCFLAGS) -run $*.c 2>&1 >$*.output; \
78 @if diff -bu $*.expect $*.output ; \
79 then \
80 rm -f $*.output \
81 : \
82 else \
83 echo "ERROR: test $*"; \
86 all: test
88 test: $(TESTS)
90 # vim: set expandtab ts=4 sw=4 sts=4 tw=80 :