2009-02-10 01:13:14 -05:00
|
|
|
TESTS= 00_assignment.test \
|
|
|
|
01_comment.test \
|
2009-02-10 01:17:28 -05:00
|
|
|
02_printf.test \
|
2009-02-10 06:18:50 -05:00
|
|
|
03_struct.test \
|
|
|
|
04_for.test \
|
2009-02-18 06:05:34 -05:00
|
|
|
05_array.test \
|
2009-02-19 06:00:51 -05:00
|
|
|
06_case.test \
|
|
|
|
07_function.test \
|
|
|
|
08_while.test \
|
2009-02-23 21:12:20 -05:00
|
|
|
09_do_while.test \
|
2009-03-06 02:27:45 -05:00
|
|
|
10_pointer.test \
|
2009-04-15 06:56:02 -04:00
|
|
|
11_precedence.test \
|
2009-03-07 20:09:42 -05:00
|
|
|
12_hashdefine.test \
|
2009-03-08 20:34:32 -04:00
|
|
|
13_integer_literals.test \
|
2009-03-09 16:48:26 -04:00
|
|
|
14_if.test \
|
2009-03-09 22:18:17 -04:00
|
|
|
15_recursion.test \
|
2009-03-09 18:36:01 -04:00
|
|
|
16_nesting.test \
|
2009-03-09 21:01:57 -04:00
|
|
|
17_enum.test \
|
2009-04-19 07:49:01 -04:00
|
|
|
18_include.test \
|
2009-04-22 04:19:52 -04:00
|
|
|
19_pointer_arithmetic.test \
|
2009-05-27 00:01:52 -04:00
|
|
|
20_pointer_comparison.test \
|
2009-06-03 20:18:28 -04:00
|
|
|
21_char_array.test \
|
2009-05-27 19:54:22 -04:00
|
|
|
22_floating_point.test \
|
2009-05-28 21:01:07 -04:00
|
|
|
23_type_coercion.test \
|
2009-06-02 22:57:23 -04:00
|
|
|
24_math_library.test \
|
2009-06-03 01:24:41 -04:00
|
|
|
25_quicksort.test \
|
2009-10-28 17:34:51 -04:00
|
|
|
26_character_constants.test \
|
|
|
|
28_strings.test \
|
2009-11-03 21:04:47 -05:00
|
|
|
29_array_address.test \
|
2010-07-03 11:20:29 -04:00
|
|
|
30_hanoi.test \
|
2010-07-03 12:10:15 -04:00
|
|
|
31_args.test \
|
2011-02-11 00:04:49 -05:00
|
|
|
32_led.test \
|
2010-07-04 15:52:52 -04:00
|
|
|
33_ternary_op.test \
|
2011-02-20 23:44:16 -05:00
|
|
|
34_array_assignment.test \
|
2009-11-08 11:33:31 -05:00
|
|
|
35_sizeof.test \
|
2009-11-14 06:11:38 -05:00
|
|
|
36_array_initialisers.test \
|
2011-02-20 23:44:16 -05:00
|
|
|
37_sprintf.test \
|
2010-06-06 13:03:15 -04:00
|
|
|
38_multiple_array_index.test \
|
2010-06-06 13:31:12 -04:00
|
|
|
39_typedef.test \
|
2010-07-18 09:42:07 -04:00
|
|
|
40_stdio.test \
|
2010-07-18 13:01:00 -04:00
|
|
|
41_hashif.test \
|
2010-07-24 12:07:56 -04:00
|
|
|
43_void_param.test \
|
2010-07-27 07:34:24 -04:00
|
|
|
44_scoped_declarations.test \
|
2011-02-10 23:49:44 -05:00
|
|
|
45_empty_for.test \
|
2011-02-11 01:27:54 -05:00
|
|
|
47_switch_return.test \
|
2011-02-14 01:05:53 -05:00
|
|
|
48_nested_break.test \
|
2011-02-15 19:19:07 -05:00
|
|
|
49_bracket_evaluation.test \
|
2011-02-16 22:17:35 -05:00
|
|
|
50_logical_second_arg.test \
|
2011-02-17 22:33:58 -05:00
|
|
|
51_static.test \
|
2011-02-20 23:44:16 -05:00
|
|
|
52_unnamed_enum.test \
|
2012-09-06 08:07:57 -04:00
|
|
|
54_goto.test \
|
2012-09-23 07:48:27 -04:00
|
|
|
55_array_initialiser.test \
|
2013-03-16 01:58:42 -04:00
|
|
|
56_cross_structure.test \
|
|
|
|
59_break_before_loop.test
|
2009-01-03 23:08:49 -05:00
|
|
|
|
2009-02-10 06:18:50 -05:00
|
|
|
%.test: %.expect %.c
|
2009-02-10 01:13:14 -05:00
|
|
|
@echo Test: $*...
|
2010-07-03 12:10:15 -04:00
|
|
|
@if [ "x`echo $* | grep args`" != "x" ]; \
|
|
|
|
then \
|
|
|
|
../picoc $*.c - arg1 arg2 arg3 arg4 2>&1 >$*.output; \
|
|
|
|
else \
|
2010-07-05 15:00:29 -04:00
|
|
|
../picoc $*.c 2>&1 >$*.output; \
|
2010-07-03 12:10:15 -04:00
|
|
|
fi
|
2009-03-01 16:26:54 -05:00
|
|
|
@if [ "x`diff -qbu $*.expect $*.output`" != "x" ]; \
|
2009-02-10 01:13:14 -05:00
|
|
|
then \
|
|
|
|
echo "error in test $*"; \
|
|
|
|
diff -u $*.expect $*.output; \
|
2009-02-10 01:17:28 -05:00
|
|
|
rm -f $*.output; \
|
2009-02-10 01:13:14 -05:00
|
|
|
exit 1; \
|
|
|
|
fi; \
|
|
|
|
rm -f $*.output
|
|
|
|
|
2009-01-03 23:08:49 -05:00
|
|
|
all: test
|
|
|
|
|
|
|
|
test: $(TESTS)
|
|
|
|
@echo "test passed"
|