History

tests: cleanup

tests: - add "hello" to test first basic compilation to file/memory - add "more" test (tests2 suite) - remove some tests tests2: - move into tests dir - Convert some files from DOS to unix LF - remove 2>&1 redirection win32: - tccrun.c: modify exception filter to exit correctly (needed for btest) - tcctest.c: exclude weak_test() (feature does not exist on win32)

grischka committed 13 years ago

Commit d5f4df01 parent 60cf64614 files · +273 −300Browse files

Unified · Split

14 files
  1. Makefile +0 −2
  2. configure +1 −1
  3. tccrun.c +1 −2
  4. tests/Makefile +47 −69
  5. tests/tcctest.c +4 −1
  6. tests/tests2/16_nesting.expect +18 −18
  7. tests/tests2/17_enum.expect +3 −3
  8. tests/tests2/18_include.expect +3 −3
  9. tests/tests2/18_include.h +1 −1
  10. tests/tests2/44_scoped_declarations.c +17 −17
  11. tests/tests2/45_empty_for.c +18 −18
  12. tests/tests2/50_logical_second_arg.c +29 −29
  13. tests/tests2/54_goto.c +56 −56
  14. tests/tests2/Makefile +75 −80
Makefile+0−2
@@ -350,12 +350,10 @@ tcc-doc.info: tcc-doc.texi · 349 unmodified lines
350350 export LIBTCC1
351351
352352 %est:
353− $(MAKE) -C tests2 $@
354353 $(MAKE) -C tests $@
355354
356355 clean:
357356 rm -vf $(PROGS) tcc_p$(EXESUF) tcc.pod *~ *.o *.a *.so* *.out *.exe libtcc_test$(EXESUF)
358− $(MAKE) -C tests2 $@
359357 $(MAKE) -C tests $@
360358 ifneq ($(LIBTCC1),)
361359 $(MAKE) -C lib $@
configure+1−1
@@ -500,7 +500,7 @@ echo "SRC_PATH=$source_path" >>config.mak · 499 unmodified lines
500500
501501 # build tree in object directory if source path is different from current one
502502 if test "$source_path_used" = "yes" ; then
503− FILES="Makefile lib/Makefile tests/Makefile tests2/Makefile"
503+ FILES="Makefile lib/Makefile tests/Makefile tests/tests2/Makefile"
504504 for f in $FILES ; do
505505 dir=`fn_dirname "$f"`
506506 test -d "$dir" || mkdir -p "$dir"
tccrun.c+1−2
@@ -615,8 +615,7 @@ static long __stdcall cpu_exception_handler(EXCEPTION_POINTERS *ex_info) · 614 unmodified lines
615615 rt_error(uc, "exception caught");
616616 break;
617617 }
618− exit(-1);
619− return EXCEPTION_CONTINUE_SEARCH;
618+ return EXCEPTION_EXECUTE_HANDLER;
620619 }
621620
622621 /* Generate a stack backtrace when a CPU exception occurs. */
tests/Makefile+47−69
@@ -7,73 +7,61 @@ include $(TOP)/Makefile · 6 unmodified lines
77 VPATH = $(top_srcdir)/tests
88
99 # what tests to run
10−TESTS = libtest \
11− test1 \
12− test2 \
13− test3 \
14− speedtest \
15− btest \
16− test1b\
17− test2b\
18− test3b\
19− weaktest
20−
21− # test4 # this test does not seem to work on any platform
22− # asmtest # this test does not seem to work on any platform
10+TESTS = \
11+ hello \
12+ libtest \
13+ test3 \
14+ moretests
15+
16+# test4 -- problem with -static
17+# asmtest -- minor differences with gcc
18+# btest -- works on i386 (including win32)
19+# test3 -- win32 does not know how to printf long doubles
2320
2421 # bounds-checking is supported only on i386
2522 ifneq ($(ARCH),i386)
26− TESTS := $(filter-out btest,$(TESTS))
27− TESTS := $(filter-out test1b,$(TESTS))
28− TESTS := $(filter-out test2b,$(TESTS))
29− TESTS := $(filter-out test3b,$(TESTS))
23+ TESTS := $(filter-out btest,$(TESTS))
3024 endif
31−
32−# these should work too
33−# TESTS += test1 test2 speedtest btest weaktest
34−
35−# some tests do not pass on all platforms, remove them for now
36−ifeq ($(TARGETOS),Linux)
37− TESTS := $(filter-out weaktest,$(TESTS))
25+ifdef CONFIG_WIN32
26+ TESTS := $(filter-out test3,$(TESTS))
3827 endif
3928 ifeq ($(TARGETOS),Darwin)
40− TESTS := $(filter-out test1,$(TESTS))
41− TESTS := $(filter-out test2,$(TESTS))
42− TESTS := $(filter-out test3,$(TESTS))
43− TESTS := $(filter-out btest,$(TESTS))
44− TESTS := $(filter-out weaktest,$(TESTS))
29+ TESTS := $(filter-out test3 btest,$(TESTS))
4530 endif
4631
4732 ifdef DISABLE_STATIC
48−export LD_LIBRARY_PATH:=$(CURDIR)/..
33+ export LD_LIBRARY_PATH:=$(CURDIR)/..
4934 endif
5035
5136 ifeq ($(TARGETOS),Darwin)
52−CFLAGS+=-Wl,-flat_namespace,-undefined,warning
53−export MACOSX_DEPLOYMENT_TARGET:=10.2
54−NATIVE_DEFINES+=-D_ANSI_SOURCE
37+ CFLAGS+=-Wl,-flat_namespace,-undefined,warning
38+ export MACOSX_DEPLOYMENT_TARGET:=10.2
39+ NATIVE_DEFINES+=-D_ANSI_SOURCE
5540 endif
5641
5742 # run local version of tcc with local libraries and includes
58−TCC = ../tcc -B.. $(NATIVE_DEFINES)
43+TCCFLAGS = -B$(TOP)
5944 ifdef CONFIG_WIN32
60− TCC := $(TCC) -I $(top_srcdir)/win32/include -L$(top_build)
45+ TCCFLAGS = -B$(top_srcdir)/win32 -I$(top_srcdir)/include -L$(TOP)
6146 endif
62−RUN_TCC = $(NATIVE_DEFINES) -run -DONE_SOURCE ../tcc.c -B..
63−DISAS=objdump -d
6447
65−all test : $(TESTS)
48+TCC = $(TOP)/tcc $(TCCFLAGS)
49+RUN_TCC = $(NATIVE_DEFINES) -DONE_SOURCE -run $(TOP)/tcc.c $(TCCFLAGS)
6650
67−# make sure that tcc exists
68−test1 test2 test3 test4 btest speedtest asmtest weaktest : ../tcc
69−../%:
70− $(MAKE) -C .. $*
51+DISAS = objdump -d
7152
7253 # libtcc test
7354 ifdef LIBTCC1
74−LIBTCC1:=$(TOP)/$(LIBTCC1)
55+ LIBTCC1:=$(TOP)/$(LIBTCC1)
7556 endif
7657
58+all test : $(TESTS)
59+
60+hello: ../examples/ex1.c
61+ @echo ------------ $@ ------------
62+ $(TCC) $< -o $@$(EXESUF) && ./$@$(EXESUF)
63+ $(TCC) -run $<
64+
7765 libtest: libtcc_test$(EXESUF) $(LIBTCC1)
7866 @echo ------------ $@ ------------
7967 ./libtcc_test$(EXESUF) lib_path=..
@@ -81,6 +69,10 @@ libtest: libtcc_test$(EXESUF) $(LIBTCC1) · 1 unmodified line
8169 libtcc_test$(EXESUF): libtcc_test.c $(top_builddir)/$(LIBTCC)
8270 $(CC) -o $@ $^ $(CPPFLAGS) $(CFLAGS) $(NATIVE_DEFINES) $(LIBS) $(LINK_LIBTCC) $(LDFLAGS)
8371
72+moretests:
73+ @echo ------------ $@ ------------
74+ $(MAKE) -C tests2
75+
8476 # test.ref - generate using gcc
8577 # copy only tcclib.h so GCC's stddef and stdarg will be used
8678 test.ref: tcctest.c
@@ -94,59 +86,44 @@ test1: test.ref · 7 unmodified lines
9486 $(TCC) -run tcctest.c > test.out1
9587 @if diff -u test.ref test.out1 ; then echo "Auto Test OK"; fi
9688
97−test1b: test.ref
98− @echo ------------ $@ ------------
99− $(TCC) -b -run tcctest.c > test.out1b
100− @if diff -u test.ref test.out1b ; then echo "Auto Test OK"; fi
101−
10289 # iterated test2 (compile tcc then compile tcctest.c !)
10390 test2: test.ref
10491 @echo ------------ $@ ------------
10592 $(TCC) $(RUN_TCC) $(RUN_TCC) -run tcctest.c > test.out2
10693 @if diff -u test.ref test.out2 ; then echo "Auto Test2 OK"; fi
10794
108−test2b: test.ref ../bcheck.o
109− @echo ------------ $@ ------------
110− $(TCC) -b $(RUN_TCC) $(RUN_TCC) -run tcctest.c > test.out2b
111− @if diff -u test.ref test.out2b ; then echo "Auto Test2b OK"; fi
112−
11395 # iterated test3 (compile tcc then compile tcc then compile tcctest.c !)
11496 test3: test.ref
11597 @echo ------------ $@ ------------
11698 $(TCC) $(RUN_TCC) $(RUN_TCC) $(RUN_TCC) -run tcctest.c > test.out3
11799 @if diff -u test.ref test.out3 ; then echo "Auto Test3 OK"; fi
118100
119−test3b: test.ref
120− @echo ------------ $@ ------------
121− $(TCC) -b $(RUN_TCC) $(RUN_TCC) $(RUN_TCC) -run tcctest.c > test.out3b
122− @if diff -u test.ref test.out3b ; then echo "Auto Test3 OK"; fi
123−
124101 # binary output test
125102 test4: test.ref
126103 @echo ------------ $@ ------------
127−# dynamic output
128− $(TCC) -o tcctest1 tcctest.c
129− ./tcctest1 > test1.out
130− @if diff -u test.ref test1.out ; then echo "Dynamic Auto Test OK"; fi
131104 # object + link output
132105 $(TCC) -c -o tcctest3.o tcctest.c
133106 $(TCC) -o tcctest3 tcctest3.o
134107 ./tcctest3 > test3.out
135108 @if diff -u test.ref test3.out ; then echo "Object Auto Test OK"; fi
136−# static output
137− $(TCC) -static -o tcctest2 tcctest.c
138− ./tcctest2 > test2.out
139− @if diff -u test.ref test2.out ; then echo "Static Auto Test OK"; fi
109+# dynamic output
110+ $(TCC) -o tcctest1 tcctest.c
111+ ./tcctest1 > test1.out
112+ @if diff -u test.ref test1.out ; then echo "Dynamic Auto Test OK"; fi
140113 # dynamic output + bound check
141114 $(TCC) -b -o tcctest4 tcctest.c
142115 ./tcctest4 > test4.out
143116 @if diff -u test.ref test4.out ; then echo "BCheck Auto Test OK"; fi
117+# static output
118+ $(TCC) -static -o tcctest2 tcctest.c
119+ ./tcctest2 > test2.out
120+ @if diff -u test.ref test2.out ; then echo "Static Auto Test OK"; fi
144121
145122 # memory and bound check auto test
146123 BOUNDS_OK = 1 4 8 10 14
147124 BOUNDS_FAIL= 2 5 7 9 11 12 13 15
148125
149−btest: boundtest.c ../bcheck.o
126+btest: boundtest.c
150127 @echo ------------ $@ ------------
151128 @for i in $(BOUNDS_OK); do \
152129 echo ; echo --- boundtest $$i ---; \
@@ -212,5 +189,6 @@ cache: tcc_g · 59 unmodified lines
212189
213190 # clean
214191 clean:
215− rm -vf *~ *.o *.a *.bin *.i *.ref *.out *.out? *.out?b *.gcc \
216− tcctest[1234] ex? libtcc_test$(EXESUF) tcc_g tcclib.h
192+ $(MAKE) -C tests2 $@
193+ rm -vf *~ *.o *.a *.bin *.i *.ref *.out *.out? *.out?b *.gcc *.exe \
194+ hello libtcc_test tcctest[1234] ex? tcc_g tcclib.h
tests/tcctest.c+4−1
@@ -594,7 +594,9 @@ int main(int argc, char **argv) · 593 unmodified lines
594594 local_label_test();
595595 asm_test();
596596 builtin_test();
597+#ifndef _WIN32
597598 weak_test();
599+#endif
598600 global_data_test();
599601 cmp_comparison_test();
600602 math_cmp_test();
@@ -2464,7 +2466,7 @@ void builtin_test(void) · 1863 unmodified lines
24642466 printf("res = %d\n", __builtin_constant_p(constant_p_var));
24652467 }
24662468
2467−
2469+#ifndef _WIN32
24682470 extern int __attribute__((weak)) weak_f1(void);
24692471 extern int __attribute__((weak)) weak_f2(void);
24702472 extern int weak_f3(void);
@@ -2520,6 +2522,7 @@ int __attribute__((weak)) weak_f2() { return 222; } · 49 unmodified lines
25202522 int __attribute__((weak)) weak_f3() { return 333; }
25212523 int __attribute__((weak)) weak_v2 = 222;
25222524 int __attribute__((weak)) weak_v3 = 333;
2525+#endif
25232526
25242527 void const_func(const int a)
25252528 {
tests/tests2/16_nesting.expect+18−18
@@ -1,18 +1,18 @@
1−0 0 0
2−0 0 1
3−0 0 2
4−0 1 0
5−0 1 1
6−0 1 2
7−0 2 0
8−0 2 1
9−0 2 2
10−1 0 0
11−1 0 1
12−1 0 2
13−1 1 0
14−1 1 1
15−1 1 2
16−1 2 0
17−1 2 1
18−1 2 2
1+0 0 0
2+0 0 1
3+0 0 2
4+0 1 0
5+0 1 1
6+0 1 2
7+0 2 0
8+0 2 1
9+0 2 2
10+1 0 0
11+1 0 1
12+1 0 2
13+1 1 0
14+1 1 1
15+1 1 2
16+1 2 0
17+1 2 1
18+1 2 2
tests/tests2/17_enum.expect+3−3
@@ -1,3 +1,3 @@
1−0 1 2 3 54 73 74 75
2−12
3−54
1+0 1 2 3 54 73 74 75
2+12
3+54
tests/tests2/18_include.expect+3−3
@@ -1,3 +1,3 @@
1−including
2−included
3−done
1+including
2+included
3+done
tests/tests2/18_include.h+1−1
@@ -1 +1 @@
1−printf("included\n");
1+printf("included\n");
tests/tests2/44_scoped_declarations.c+17−17
@@ -1,17 +1,17 @@
1−#include <stdio.h>
2−
3−int main()
4−{
5− int a;
6−
7− for (a = 0; a < 2; a++)
8− {
9− int b = a;
10− }
11−
12− printf("it's all good\n");
13−
14− return 0;
15−}
16−
17−/* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/
1+#include <stdio.h>
2+
3+int main()
4+{
5+ int a;
6+
7+ for (a = 0; a < 2; a++)
8+ {
9+ int b = a;
10+ }
11+
12+ printf("it's all good\n");
13+
14+ return 0;
15+}
16+
17+/* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/
tests/tests2/45_empty_for.c+18−18
@@ -1,18 +1,18 @@
1−#include <stdio.h>
2−
3−int main()
4−{
5− int Count = 0;
6−
7− for (;;)
8− {
9− Count++;
10− printf("%d\n", Count);
11− if (Count >= 10)
12− break;
13− }
14−
15− return 0;
16−}
17−
18−/* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/
1+#include <stdio.h>
2+
3+int main()
4+{
5+ int Count = 0;
6+
7+ for (;;)
8+ {
9+ Count++;
10+ printf("%d\n", Count);
11+ if (Count >= 10)
12+ break;
13+ }
14+
15+ return 0;
16+}
17+
18+/* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/
tests/tests2/50_logical_second_arg.c+29−29
@@ -1,29 +1,29 @@
1−#include <stdio.h>
2−
3−int fred()
4−{
5− printf("fred\n");
6− return 0;
7−}
8−
9−int joe()
10−{
11− printf("joe\n");
12− return 1;
13−}
14−
15−int main()
16−{
17− printf("%d\n", fred() && joe());
18− printf("%d\n", fred() || joe());
19− printf("%d\n", joe() && fred());
20− printf("%d\n", joe() || fred());
21− printf("%d\n", fred() && (1 + joe()));
22− printf("%d\n", fred() || (0 + joe()));
23− printf("%d\n", joe() && (0 + fred()));
24− printf("%d\n", joe() || (1 + fred()));
25−
26− return 0;
27−}
28−
29−/* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/
1+#include <stdio.h>
2+
3+int fred()
4+{
5+ printf("fred\n");
6+ return 0;
7+}
8+
9+int joe()
10+{
11+ printf("joe\n");
12+ return 1;
13+}
14+
15+int main()
16+{
17+ printf("%d\n", fred() && joe());
18+ printf("%d\n", fred() || joe());
19+ printf("%d\n", joe() && fred());
20+ printf("%d\n", joe() || fred());
21+ printf("%d\n", fred() && (1 + joe()));
22+ printf("%d\n", fred() || (0 + joe()));
23+ printf("%d\n", joe() && (0 + fred()));
24+ printf("%d\n", joe() || (1 + fred()));
25+
26+ return 0;
27+}
28+
29+/* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/
tests/tests2/54_goto.c+56−56
@@ -1,56 +1,56 @@
1−#include <stdio.h>
2−
3−void fred()
4−{
5− printf("In fred()\n");
6− goto done;
7− printf("In middle\n");
8−done:
9− printf("At end\n");
10−}
11−
12−void joe()
13−{
14− int b = 5678;
15−
16− printf("In joe()\n");
17−
18− {
19− int c = 1234;
20− printf("c = %d\n", c);
21− goto outer;
22− printf("uh-oh\n");
23− }
24−
25−outer:
26−
27− printf("done\n");
28−}
29−
30−void henry()
31−{
32− int a;
33−
34− printf("In henry()\n");
35− goto inner;
36−
37− {
38− int b;
39−inner:
40− b = 1234;
41− printf("b = %d\n", b);
42− }
43−
44− printf("done\n");
45−}
46−
47−int main()
48−{
49− fred();
50− joe();
51− henry();
52−
53− return 0;
54−}
55−
56−/* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/
1+#include <stdio.h>
2+
3+void fred()
4+{
5+ printf("In fred()\n");
6+ goto done;
7+ printf("In middle\n");
8+done:
9+ printf("At end\n");
10+}
11+
12+void joe()
13+{
14+ int b = 5678;
15+
16+ printf("In joe()\n");
17+
18+ {
19+ int c = 1234;
20+ printf("c = %d\n", c);
21+ goto outer;
22+ printf("uh-oh\n");
23+ }
24+
25+outer:
26+
27+ printf("done\n");
28+}
29+
30+void henry()
31+{
32+ int a;
33+
34+ printf("In henry()\n");
35+ goto inner;
36+
37+ {
38+ int b;
39+inner:
40+ b = 1234;
41+ printf("b = %d\n", b);
42+ }
43+
44+ printf("done\n");
45+}
46+
47+int main()
48+{
49+ fred();
50+ joe();
51+ henry();
52+
53+ return 0;
54+}
55+
56+/* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/
tests/tests2/Makefile+75−80
@@ -1,103 +1,98 @@
1−TOP = ..
1+TOP = ../..
22 include $(TOP)/Makefile
3−VPATH = $(top_srcdir)/tests2
3+VPATH = $(top_srcdir)/tests/tests2
44
5−ifeq ($(TARGETOS),Darwin)
6− CFLAGS+=-Wl,-flat_namespace,-undefined,warning
7− TCCFLAGS=-D_ANSI_SOURCE
8− export MACOSX_DEPLOYMENT_TARGET:=10.2
5+TCCFLAGS = -B$(TOP)
6+ifdef CONFIG_WIN32
7+ TCCFLAGS = -B$(top_srcdir)/win32 -I$(top_srcdir)/include -L$(TOP)
98 endif
109
11−ifdef CONFIG_WIN32
12− TCCFLAGS=-I $(TOP)/win32/include -L$(TOP)
10+ifeq ($(TARGETOS),Darwin)
11+ CFLAGS += -Wl,-flat_namespace,-undefined,warning
12+ TCCFLAGS += -D_ANSI_SOURCE
13+ export MACOSX_DEPLOYMENT_TARGET:=10.2
1314 endif
1415
15−TESTS= 00_assignment.test \
16− 01_comment.test \
17− 02_printf.test \
18− 03_struct.test \
19− 04_for.test \
20− 05_array.test \
21− 06_case.test \
22− 07_function.test \
23− 08_while.test \
24− 09_do_while.test \
25− 10_pointer.test \
26− 11_precedence.test \
27− 12_hashdefine.test \
28− 13_integer_literals.test \
29− 14_if.test \
30− 15_recursion.test \
31− 16_nesting.test \
32− 17_enum.test \
33− 18_include.test \
34− 19_pointer_arithmetic.test \
35− 20_pointer_comparison.test \
36− 21_char_array.test \
37− 22_floating_point.test \
38− 23_type_coercion.test \
39− 24_math_library.test \
40− 25_quicksort.test \
41− 26_character_constants.test \
42− 27_sizeof.test \
43− 28_strings.test \
44− 29_array_address.test \
45− 31_args.test \
46− 32_led.test \
47− 33_ternary_op.test \
48− 35_sizeof.test \
49− 36_array_initialisers.test \
50− 37_sprintf.test \
51− 38_multiple_array_index.test \
52− 39_typedef.test \
53− 40_stdio.test \
54− 41_hashif.test \
55− 42_function_pointer.test \
56− 43_void_param.test \
57− 44_scoped_declarations.test \
58− 45_empty_for.test \
59− 47_switch_return.test \
60− 48_nested_break.test \
61− 49_bracket_evaluation.test \
62− 50_logical_second_arg.test \
63− 51_static.test \
64− 52_unnamed_enum.test \
65− 54_goto.test \
66− 55_lshift_type.test
16+TCC_RUN = $(TOP)/tcc $(TCCFLAGS) -run
6717
68− # 30_hanoi.test \ # seg fault in the code, gcc as well
69− # 34_array_assignment.test \ # array assignment is not in C standard
70− # 46_grep.test \ # does not compile even with gcc
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+ 31_args.test \
50+ 32_led.test \
51+ 33_ternary_op.test \
52+ 35_sizeof.test \
53+ 36_array_initialisers.test \
54+ 37_sprintf.test \
55+ 38_multiple_array_index.test \
56+ 39_typedef.test \
57+ 40_stdio.test \
58+ 41_hashif.test \
59+ 42_function_pointer.test \
60+ 43_void_param.test \
61+ 44_scoped_declarations.test \
62+ 45_empty_for.test \
63+ 47_switch_return.test \
64+ 48_nested_break.test \
65+ 49_bracket_evaluation.test \
66+ 50_logical_second_arg.test \
67+ 51_static.test \
68+ 52_unnamed_enum.test \
69+ 54_goto.test \
70+ 55_lshift_type.test
71+
72+# 30_hanoi.test -- seg fault in the code, gcc as well
73+# 34_array_assignment.test -- array assignment is not in C standard
74+# 46_grep.test -- does not compile even with gcc
7175
7276 # some tests do not pass on all platforms, remove them for now
7377 ifeq ($(TARGETOS),Darwin)
74− TESTS := $(filter-out 40_stdio.test,$(TESTS))
78+ TESTS := $(filter-out 40_stdio.test,$(TESTS))
7579 endif
7680 ifdef CONFIG_WIN32
77− TESTS := $(filter-out 24_math_library.test,$(TESTS))
78− TESTS := $(filter-out 28_strings.test,$(TESTS))
81+ TESTS := $(filter-out 24_math_library.test 28_strings.test,$(TESTS))
7982 endif
8083
8184 %.test: %.c %.expect
8285 @echo Test: $*...
8386 @if [ "x`echo $* | grep args`" != "x" ]; \
84− then \
85− ../tcc -B.. $(TCCFLAGS) -run $< - arg1 arg2 arg3 arg4 2>&1 >$*.output; \
86− else \
87− ../tcc -B.. $(TCCFLAGS) -run $< 2>&1 >$*.output; \
87+ then $(TCC_RUN) $< - arg1 arg2 arg3 arg4 >$*.output; \
88+ else $(TCC_RUN) $< >$*.output; \
8889 fi
8990 @if diff -bu $(<:.c=.expect) $*.output ; \
90− then \
91− rm -f $*.output \
92− else \
93− echo "ERROR: test $*"; \
91+ then rm -f $*.output; \
92+ else exit 1; \
9493 fi
9594
96−all: test
97−
98−test: $(TESTS)
99−
100−# vim: set expandtab ts=4 sw=4 sts=4 tw=80 :
95+all test: $(TESTS)
10196
10297 clean:
103− rm -vf fred.txt
98+ rm -vf fred.txt *.output

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t