History

tests: Minor adjustments selecting which tests are run on each platform.

The intent is for 'make test' to pass cleanly on each platform, and thus easier spotting of regressions. Linux is best supported by most tests running and passing. Mac OSX passes mosts tests that do not make/link with binary files, due to lack of mach-o file support. !!! I have very limited knowledge of Windows platform, and cannot comment why all tests(1) fail. I have posted to newsgroup asking for someone to test Windows platform.

Milutin Jovanović committed 14 years ago

Commit d54e24c1 parent 240064c2 files · +41 −11Browse files

Unified · Split

2 files
  1. tests/Makefile +31 −9
  2. tests2/Makefile +10 −2
tests/Makefile+31−9
@@ -2,17 +2,36 @@ · 1 unmodified line
22 # Tiny C Compiler Makefile - tests
33 #
44
5+TOP = ..
6+include $(TOP)/Makefile
7+
58 # what tests to run
6−TESTS = libtest test3
9+TESTS = libtest \
10+ test1 \
11+ test2 \
12+ test3 \
13+ speedtest \
14+ btest \
15+ weaktest
16+
17+ # test4 # this test does not seem to work on any platform
18+ # asmtest # this test does not seem to work on any platform
719
820 # these should work too
921 # TESTS += test1 test2 speedtest btest weaktest
1022
11−# these don't work as they should
12−# TESTS += test4 asmtest
13−
14−TOP = ..
15−include $(TOP)/Makefile
23+# some tests do not pass on all platforms, remove them for now
24+ifeq ($(TARGETOS),Linux)
25+ TESTS := $(filter-out btest,$(TESTS))
26+ TESTS := $(filter-out weaktest,$(TESTS))
27+endif
28+ifeq ($(TARGETOS),Darwin)
29+ TESTS := $(filter-out test1,$(TESTS))
30+ TESTS := $(filter-out test2,$(TESTS))
31+ TESTS := $(filter-out test3,$(TESTS))
32+ TESTS := $(filter-out btest,$(TESTS))
33+ TESTS := $(filter-out weaktest,$(TESTS))
34+endif
1635
1736 ifdef DISABLE_STATIC
1837 export LD_LIBRARY_PATH:=$(CURDIR)/..
@@ -25,7 +44,10 @@ NATIVE_DEFINES+=-D_ANSI_SOURCE · 6 unmodified lines
2544 endif
2645
2746 # run local version of tcc with local libraries and includes
28−TCC = ../tcc -B..
47+TCC = ../tcc -B.. $(NATIVE_DEFINES)
48+ifdef CONFIG_WIN32
49+ TCC := $(TCC) -I $(TOP)/win32/include -L$(TOP)
50+endif
2951 RUN_TCC = $(NATIVE_DEFINES) -run -DONE_SOURCE ../tcc.c -B..
3052 DISAS=objdump -d
3153
@@ -46,13 +68,13 @@ libtest: libtcc_test$(EXESUF) $(LIBTCC1) · 14 unmodified lines
4668 ./libtcc_test$(EXESUF) lib_path=..
4769
4870 libtcc_test$(EXESUF): libtcc_test.c ../$(LIBTCC)
49− $(CC) -o $@ $^ -I.. $(CFLAGS) $(LIBS) $(LINK_LIBTCC)
71+ $(CC) -o $@ $^ -I.. $(CFLAGS) $(NATIVE_DEFINES) $(LIBS) $(LINK_LIBTCC)
5072
5173 # test.ref - generate using gcc
5274 # copy only tcclib.h so GCC's stddef and stdarg will be used
5375 test.ref: tcctest.c
5476 cp ../include/tcclib.h .
55− $(CC) -o tcctest.gcc $< -I. -w $(CFLAGS) -std=gnu99
77+ $(CC) -o tcctest.gcc $< -I. -w $(CFLAGS) $(NATIVE_DEFINES) -std=gnu99
5678 ./tcctest.gcc > $@
5779
5880 # auto test
tests2/Makefile+10−2
@@ -67,9 +67,18 @@ TESTS= 00_assignment.test \ · 66 unmodified lines
6767 # 34_array_assignment.test \ # array assignment is not in C standard
6868 # 46_grep.test \ # does not compile even with gcc
6969
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
78+
7079 %.test: %.expect %.c
7180 @echo Test: $*...
72− -@if [ "x`echo $* | grep args`" != "x" ]; \
81+ @if [ "x`echo $* | grep args`" != "x" ]; \
7382 then \
7483 ../tcc -B.. $(TCCFLAGS) -run $*.c - arg1 arg2 arg3 arg4 2>&1 >$*.output; \
7584 else \
@@ -78,7 +87,6 @@ TESTS= 00_assignment.test \ · 2 unmodified lines
7887 @if diff -bu $*.expect $*.output ; \
7988 then \
8089 rm -f $*.output \
81− : \
8290 else \
8391 echo "ERROR: test $*"; \
8492 fi

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