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
2# Tiny C Compiler Makefile - tests2# Tiny C Compiler Makefile - tests
3#3#
4 4
5TOP = ..
6include $(TOP)/Makefile
7
5# what tests to run8# what tests to run
6TESTS = libtest test39TESTS = 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
7 19
8# these should work too20# these should work too
9# TESTS += test1 test2 speedtest btest weaktest21# TESTS += test1 test2 speedtest btest weaktest
10 22
11# these don't work as they should23# some tests do not pass on all platforms, remove them for now
12# TESTS += test4 asmtest24ifeq ($(TARGETOS),Linux)
13 25 TESTS := $(filter-out btest,$(TESTS))
14TOP = ..26 TESTS := $(filter-out weaktest,$(TESTS))
15include $(TOP)/Makefile27endif
28ifeq ($(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))
34endif
16 35
17ifdef DISABLE_STATIC36ifdef DISABLE_STATIC
18export LD_LIBRARY_PATH:=$(CURDIR)/..37export LD_LIBRARY_PATH:=$(CURDIR)/..
@@ -25,7 +44,10 @@ NATIVE_DEFINES+=-D_ANSI_SOURCE · 6 unmodified lines
25endif44endif
26 45
27# run local version of tcc with local libraries and includes46# run local version of tcc with local libraries and includes
28TCC = ../tcc -B..47TCC = ../tcc -B.. $(NATIVE_DEFINES)
48ifdef CONFIG_WIN32
49 TCC := $(TCC) -I $(TOP)/win32/include -L$(TOP)
50endif
29RUN_TCC = $(NATIVE_DEFINES) -run -DONE_SOURCE ../tcc.c -B..51RUN_TCC = $(NATIVE_DEFINES) -run -DONE_SOURCE ../tcc.c -B..
30DISAS=objdump -d52DISAS=objdump -d
31 53
@@ -46,13 +68,13 @@ libtest: libtcc_test$(EXESUF) $(LIBTCC1) · 14 unmodified lines
46 ./libtcc_test$(EXESUF) lib_path=..68 ./libtcc_test$(EXESUF) lib_path=..
47 69
48libtcc_test$(EXESUF): libtcc_test.c ../$(LIBTCC)70libtcc_test$(EXESUF): libtcc_test.c ../$(LIBTCC)
49 $(CC) -o $@ $^ -I.. $(CFLAGS) $(LIBS) $(LINK_LIBTCC)71 $(CC) -o $@ $^ -I.. $(CFLAGS) $(NATIVE_DEFINES) $(LIBS) $(LINK_LIBTCC)
50 72
51# test.ref - generate using gcc73# test.ref - generate using gcc
52# copy only tcclib.h so GCC's stddef and stdarg will be used74# copy only tcclib.h so GCC's stddef and stdarg will be used
53test.ref: tcctest.c75test.ref: tcctest.c
54 cp ../include/tcclib.h .76 cp ../include/tcclib.h .
55 $(CC) -o tcctest.gcc $< -I. -w $(CFLAGS) -std=gnu9977 $(CC) -o tcctest.gcc $< -I. -w $(CFLAGS) $(NATIVE_DEFINES) -std=gnu99
56 ./tcctest.gcc > $@78 ./tcctest.gcc > $@
57 79
58# auto test80# auto test
tests2/Makefile+10−2
@@ -67,9 +67,18 @@ TESTS= 00_assignment.test \ · 66 unmodified lines
67 # 34_array_assignment.test \ # array assignment is not in C standard67 # 34_array_assignment.test \ # array assignment is not in C standard
68 # 46_grep.test \ # does not compile even with gcc68 # 46_grep.test \ # does not compile even with gcc
69 69
70# some tests do not pass on all platforms, remove them for now
71ifeq ($(TARGETOS),Darwin)
72 TESTS := $(filter-out 40_stdio.test,$(TESTS))
73endif
74ifdef CONFIG_WIN32
75 TESTS := $(filter-out 24_math_library.test,$(TESTS))
76 TESTS := $(filter-out 28_strings.test,$(TESTS))
77endif
78
70%.test: %.expect %.c79%.test: %.expect %.c
71 @echo Test: $*...80 @echo Test: $*...
72 -@if [ "x`echo $* | grep args`" != "x" ]; \81 @if [ "x`echo $* | grep args`" != "x" ]; \
73 then \82 then \
74 ../tcc -B.. $(TCCFLAGS) -run $*.c - arg1 arg2 arg3 arg4 2>&1 >$*.output; \83 ../tcc -B.. $(TCCFLAGS) -run $*.c - arg1 arg2 arg3 arg4 2>&1 >$*.output; \
75 else \84 else \
@@ -78,7 +87,6 @@ TESTS= 00_assignment.test \ · 2 unmodified lines
78 @if diff -bu $*.expect $*.output ; \87 @if diff -bu $*.expect $*.output ; \
79 then \88 then \
80 rm -f $*.output \89 rm -f $*.output \
81 : \
82 else \90 else \
83 echo "ERROR: test $*"; \91 echo "ERROR: test $*"; \
84 fi92 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