From 1a4af4684c659a37625785fab9422de206c7991c Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Fri, 11 Jul 2008 17:22:26 +0000 Subject: - add error-counter, do not immediately exit if a testcase fails but print the overall error-counter at the end and exit accordingly. --- test/Makefile | 3 ++- test/Rules.mak | 2 ++ test/Test.mak | 8 +++++++- 3 files changed, 11 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/Makefile b/test/Makefile index c9d152477..5b240f49b 100644 --- a/test/Makefile +++ b/test/Makefile @@ -40,17 +40,18 @@ ifeq ($(HAS_NO_THREADS),y) endif DIRS := $(filter-out math,$(DIRS)) - test check all: run run: compile subdirs_run compile:subdirs_compile + @echo 0 > $(COUNTER) tags: ctags -R clean: subdirs_clean + @rm -f $(COUNTER) subdirs: $(patsubst %, _dir_%, $(DIRS)) subdirs_compile: $(patsubst %, _dircompile_%, $(DIRS)) diff --git a/test/Rules.mak b/test/Rules.mak index b74d941b6..88a8f7d7f 100644 --- a/test/Rules.mak +++ b/test/Rules.mak @@ -13,6 +13,8 @@ top_builddir ?= ../ TESTDIR=$(top_builddir)test/ +COUNTER = $(TESTDIR).errcounter + include $(top_builddir)/Rules.mak ifndef TEST_INSTALLED_UCLIBC ifdef UCLIBC_LDSO diff --git a/test/Test.mak b/test/Test.mak index dc587deca..dc416dc7d 100644 --- a/test/Test.mak +++ b/test/Test.mak @@ -30,6 +30,7 @@ endif ifeq ($(UCLIBC_ONLY),) TARGETS += $(G_TARGETS) endif + CLEAN_TARGETS := $(U_TARGETS) $(G_TARGETS) COMPILE_TARGETS := $(TARGETS) RUN_TARGETS := $(patsubst %,%.exe,$(TARGETS)) @@ -65,13 +66,18 @@ define exec_test if ! test $$ret -eq $$expected_ret ; then \ echo "ret == $$ret ; expected_ret == $$expected_ret" ; \ cat "$(binary_name).out" ; \ - exit 1 ; \ + numerr="`cat $(COUNTER)`" ; \ + expr $$numerr + 1 > $(COUNTER) ; \ fi $(SCAT) "$(binary_name).out" endef test check all: run run: $(RUN_TARGETS) compile + @numerr="`cat $(COUNTER)`" ; \ + echo "Encountered $$numerr errors" ; \ + test $$numerr -eq 0 || exit 1 + $(RUN_TARGETS): $(TARGETS) $(exec_test) $(diff_test) -- cgit v1.2.3