Showing the changes to tests (3 of 6 files). Show all
Unified · Split
| @@ -4,8 +4,8 @@ · 3 unmodified lines | ||
| 4 | 4 | |
| 5 | 5 | TOP = .. |
| 6 | 6 | include $(TOP)/Makefile |
| 7 | −VPATH = $(TOP)/tests $(TOP) | |
| 8 | −CFLAGS = -I$(TOP) | |
| 7 | +VPATH = $(TOPSRC)/tests $(TOPSRC) $(TOP) | |
| 8 | +CFLAGS = -I$(TOPSRC) -I$(TOP) | |
| 9 | 9 | |
| 10 | 10 | # what tests to run |
| 11 | 11 | TESTS = \ |
| @@ -42,14 +42,14 @@ ifeq ($(CONFIG_arm_eabi),yes) · 30 unmodified lines | ||
| 42 | 42 | endif |
| 43 | 43 | |
| 44 | 44 | # run local version of tcc with local libraries and includes |
| 45 | −TCCFLAGS = -B$(TOP) -I$(TOP) | |
| 45 | +TCCFLAGS = -B$(TOP) -I$(TOPSRC)/include -I$(TOPSRC) -I$(TOP) | |
| 46 | 46 | ifdef CONFIG_WIN32 |
| 47 | − TCCFLAGS = -B$(TOP)/win32 -I$(TOP)/include -I$(TOP) -L$(TOP) | |
| 47 | + TCCFLAGS = -B$(TOPSRC)/win32 -I$(TOPSRC)/include -I$(TOPSRC) -I$(TOP) -L$(TOP) | |
| 48 | 48 | PATH := $(CURDIR)/$(TOP):$(PATH) # for libtcc_test to find libtcc.dll |
| 49 | 49 | endif |
| 50 | 50 | |
| 51 | 51 | TCC = $(TOP)/tcc $(TCCFLAGS) |
| 52 | −RUN_TCC = $(NATIVE_DEFINES) -DONE_SOURCE -run $(TOP)/tcc.c $(TCCFLAGS) | |
| 52 | +RUN_TCC = $(NATIVE_DEFINES) -DONE_SOURCE -run $(TOPSRC)/tcc.c $(TCCFLAGS) | |
| 53 | 53 | |
| 54 | 54 | ifeq ($(TARGETOS),Darwin) |
| 55 | 55 | CFLAGS += -Wl,-flat_namespace,-undefined,warning |
| @@ -154,9 +154,9 @@ btest: boundtest.c · 98 unmodified lines | ||
| 154 | 154 | speedtest: ex2 ex3 |
| 155 | 155 | @echo ------------ $@ ------------ |
| 156 | 156 | time ./ex2 1238 2 3 4 10 13 4 |
| 157 | − time $(TCC) -run $(TOP)/examples/ex2.c 1238 2 3 4 10 13 4 | |
| 157 | + time $(TCC) -run $(TOPSRC)/examples/ex2.c 1238 2 3 4 10 13 4 | |
| 158 | 158 | time ./ex3 35 |
| 159 | − time $(TCC) -run $(TOP)/examples/ex3.c 35 | |
| 159 | + time $(TCC) -run $(TOPSRC)/examples/ex3.c 35 | |
| 160 | 160 | |
| 161 | 161 | weaktest: tcctest.c test.ref |
| 162 | 162 | $(TCC) -c $< -o weaktest.tcc.o |
| @@ -165,7 +165,7 @@ weaktest: tcctest.c test.ref · 2 unmodified lines | ||
| 165 | 165 | objdump -t weaktest.gcc.o | grep ' w ' | sed -e 's/.* \([a-zA-Z0-9_]*\)$$/\1/' | LC_ALL=C sort > weaktest.gcc.o.txt |
| 166 | 166 | diff weaktest.gcc.o.txt weaktest.tcc.o.txt && echo "Weak Auto Test OK" |
| 167 | 167 | |
| 168 | −ex%: $(TOP)/examples/ex%.c | |
| 168 | +ex%: $(TOPSRC)/examples/ex%.c | |
| 169 | 169 | $(CC) -o $@ $< $(CFLAGS) |
| 170 | 170 | |
| 171 | 171 | # tiny assembler testing |
| @@ -2,8 +2,13 @@ · 1 unmodified line | ||
| 2 | 2 | # credits: 01..13.c from the pcc cpp-tests suite |
| 3 | 3 | # |
| 4 | 4 | |
| 5 | +TOP = ../.. | |
| 6 | +include $(TOP)/config.mak | |
| 7 | +SRC = $(TOPSRC)/tests/pp | |
| 8 | +VPATH = $(SRC) | |
| 9 | + | |
| 5 | 10 | TCC = ../../tcc |
| 6 | −files = $(patsubst %.$1,%.test,$(wildcard *.$1)) | |
| 11 | +files = $(patsubst %.$1,%.test,$(notdir $(wildcard $(SRC)/*.$1))) | |
| 7 | 12 | TESTS = $(call files,c) $(call files,S) |
| 8 | 13 | |
| 9 | 14 | all test : $(sort $(TESTS)) |
| @@ -13,13 +18,13 @@ DIFF_OPTS = -Nu -b -B -I "^\#" · 3 unmodified lines | ||
| 13 | 18 | %.test: %.c %.expect |
| 14 | 19 | @echo PPTest $* ... |
| 15 | 20 | -@$(TCC) -E -P $< >$*.output 2>&1 ; \ |
| 16 | − diff $(DIFF_OPTS) $*.expect $*.output \ | |
| 21 | + diff $(DIFF_OPTS) $(SRC)/$*.expect $*.output \ | |
| 17 | 22 | && rm -f $*.output |
| 18 | 23 | |
| 19 | 24 | %.test: %.S %.expect |
| 20 | 25 | @echo PPTest $* ... |
| 21 | 26 | -@$(TCC) -E -P $< >$*.output 2>&1 ; \ |
| 22 | − diff $(DIFF_OPTS) $*.expect $*.output \ | |
| 27 | + diff $(DIFF_OPTS) $(SRC)/$*.expect $*.output \ | |
| 23 | 28 | && rm -f $*.output |
| 24 | 29 | |
| 25 | 30 | # automatically generate .expect files with gcc: |
| @@ -1,14 +1,16 @@ | ||
| 1 | 1 | TOP = ../.. |
| 2 | −include $(TOP)/Makefile | |
| 2 | +include $(TOP)/config.mak | |
| 3 | +SRC = $(TOPSRC)/tests/tests2 | |
| 4 | +VPATH = $(SRC) | |
| 3 | 5 | |
| 4 | 6 | # run local version of tcc with local libraries and includes |
| 5 | −TCCFLAGS = -B$(TOP) -I$(TOP) | |
| 7 | +TCCFLAGS = -B$(TOP) -I$(TOPSRC)/include | |
| 6 | 8 | ifdef CONFIG_WIN32 |
| 7 | − TCCFLAGS = -B$(TOP)/win32 -I$(TOP)/include -I$(TOP) -L$(TOP) | |
| 9 | + TCCFLAGS = -B$(TOPSRC)/win32 -I$(TOPSRC)/include -L$(TOP) | |
| 8 | 10 | endif |
| 9 | 11 | TCC = $(TOP)/tcc $(TCCFLAGS) |
| 10 | 12 | |
| 11 | −TESTS = $(patsubst %.c,%.test,$(sort $(wildcard *.c))) | |
| 13 | +TESTS = $(patsubst %.c,%.test,$(sort $(notdir $(wildcard $(SRC)/*.c)))) | |
| 12 | 14 | |
| 13 | 15 | # 34_array_assignment.test -- array assignment is not in C standard |
| 14 | 16 | SKIP = 34_array_assignment.test |
| @@ -34,15 +36,16 @@ endif · 19 unmodified lines | ||
| 34 | 36 | # Some tests might need arguments |
| 35 | 37 | ARGS = |
| 36 | 38 | 31_args.test : ARGS = arg1 arg2 arg3 arg4 arg5 |
| 37 | −46_grep.test : ARGS = '[^* ]*[:a:d: ]+\:\*-/: $$' 46_grep.c | |
| 39 | +46_grep.test : ARGS = '[^* ]*[:a:d: ]+\:\*-/: $$' $(SRC)/46_grep.c | |
| 38 | 40 | |
| 39 | 41 | # Some tests might need different flags |
| 40 | 42 | 76_dollars_in_identifiers.test : TCCFLAGS += -fdollars-in-identifiers |
| 41 | 43 | |
| 44 | +# Filter source directory in warnings/errors (out-of-tree builds) | |
| 45 | +FILTER = 2>&1 | sed 's,$(SRC)/,,g' | |
| 42 | 46 | # Filter some always-warning |
| 43 | −FILTER = | |
| 44 | 47 | ifeq (-$(findstring arm,$(ARCH))-,-arm-) |
| 45 | −FILTER = 2>&1 | grep -v 'warning: soft float ABI currently not supported' | |
| 48 | +FILTER += 2>&1 | grep -v 'warning: soft float ABI currently not supported' | |
| 46 | 49 | endif |
| 47 | 50 | |
| 48 | 51 | all test: $(filter-out $(SKIP),$(TESTS)) |
| @@ -51,10 +54,7 @@ all test: $(filter-out $(SKIP),$(TESTS)) · 2 unmodified lines | ||
| 51 | 54 | @echo Test: $*... |
| 52 | 55 | # test -run |
| 53 | 56 | @$(TCC) -run $< $(ARGS) $(FILTER) >$*.output 2>&1 || true |
| 54 | − @diff -Nbu $*.expect $*.output && rm -f $*.output | |
| 55 | −# test exe (disabled for speed) | |
| 56 | −# @($(TCC) $(FLAGS) $< -o $*.exe && ./$*.exe $(ARGS)) $(FiLTER) >$*.output2 2>&1 ; \ | |
| 57 | −# diff -Nbu $*.expect $*.output2 && rm -f $*.output2 $*.exe | |
| 57 | + @diff -Nbu $(SRC)/$*.expect $*.output && rm -f $*.output | |
| 58 | 58 | |
| 59 | 59 | # automatically generate .expect files with gcc: |
| 60 | 60 | %.expect : |