aboutsummaryrefslogtreecommitdiff
path: root/tests/tests2
diff options
context:
space:
mode:
authorgrischka <grischka>2016-10-01 21:06:53 +0200
committergrischka <grischka>2016-10-01 21:06:53 +0200
commitafdbc5b8152debb2ef053720b95f37a4cf4106eb (patch)
tree3e9b1d365027f9f3dc674729664d9d175d21fab2 /tests/tests2
parent0a624782dfc8fee6f0600066b135d3b20e4274f4 (diff)
downloadtinycc-afdbc5b8152debb2ef053720b95f37a4cf4106eb.tar.gz
tinycc-afdbc5b8152debb2ef053720b95f37a4cf4106eb.tar.bz2
build: restore out-of-tree support
Diffstat (limited to 'tests/tests2')
-rw-r--r--tests/tests2/Makefile22
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/tests2/Makefile b/tests/tests2/Makefile
index 587f1e7..67d65a4 100644
--- a/tests/tests2/Makefile
+++ b/tests/tests2/Makefile
@@ -1,14 +1,16 @@
TOP = ../..
-include $(TOP)/Makefile
+include $(TOP)/config.mak
+SRC = $(TOPSRC)/tests/tests2
+VPATH = $(SRC)
# run local version of tcc with local libraries and includes
-TCCFLAGS = -B$(TOP) -I$(TOP)
+TCCFLAGS = -B$(TOP) -I$(TOPSRC)/include
ifdef CONFIG_WIN32
- TCCFLAGS = -B$(TOP)/win32 -I$(TOP)/include -I$(TOP) -L$(TOP)
+ TCCFLAGS = -B$(TOPSRC)/win32 -I$(TOPSRC)/include -L$(TOP)
endif
TCC = $(TOP)/tcc $(TCCFLAGS)
-TESTS = $(patsubst %.c,%.test,$(sort $(wildcard *.c)))
+TESTS = $(patsubst %.c,%.test,$(sort $(notdir $(wildcard $(SRC)/*.c))))
# 34_array_assignment.test -- array assignment is not in C standard
SKIP = 34_array_assignment.test
@@ -34,15 +36,16 @@ endif
# Some tests might need arguments
ARGS =
31_args.test : ARGS = arg1 arg2 arg3 arg4 arg5
-46_grep.test : ARGS = '[^* ]*[:a:d: ]+\:\*-/: $$' 46_grep.c
+46_grep.test : ARGS = '[^* ]*[:a:d: ]+\:\*-/: $$' $(SRC)/46_grep.c
# Some tests might need different flags
76_dollars_in_identifiers.test : TCCFLAGS += -fdollars-in-identifiers
+# Filter source directory in warnings/errors (out-of-tree builds)
+FILTER = 2>&1 | sed 's,$(SRC)/,,g'
# Filter some always-warning
-FILTER =
ifeq (-$(findstring arm,$(ARCH))-,-arm-)
-FILTER = 2>&1 | grep -v 'warning: soft float ABI currently not supported'
+FILTER += 2>&1 | grep -v 'warning: soft float ABI currently not supported'
endif
all test: $(filter-out $(SKIP),$(TESTS))
@@ -51,10 +54,7 @@ all test: $(filter-out $(SKIP),$(TESTS))
@echo Test: $*...
# test -run
@$(TCC) -run $< $(ARGS) $(FILTER) >$*.output 2>&1 || true
- @diff -Nbu $*.expect $*.output && rm -f $*.output
-# test exe (disabled for speed)
-# @($(TCC) $(FLAGS) $< -o $*.exe && ./$*.exe $(ARGS)) $(FiLTER) >$*.output2 2>&1 ; \
-# diff -Nbu $*.expect $*.output2 && rm -f $*.output2 $*.exe
+ @diff -Nbu $(SRC)/$*.expect $*.output && rm -f $*.output
# automatically generate .expect files with gcc:
%.expect :