diff -r e3d532dd8b5d -r 10ad7f230f4b contrib/gcc-test-suite/Makefile --- a/contrib/gcc-test-suite/Makefile Wed May 19 17:53:04 2010 +0200 +++ b/contrib/gcc-test-suite/Makefile Sat May 22 22:04:31 2010 +0200 @@ -12,64 +12,68 @@ # option) any later version. # -# Internal directory configuration -TOPDIR=${shell pwd} -TMPDIR=${TOPDIR}/tmp +# Internal configuration +TARGET:=@@DG_TARGET@@ +TOPDIR:=$(shell pwd) +LOGDIR:=$(TOPDIR)/tmp # Include default configuration include default.cfg # Add toolchain to path -PATH:=${DG_TOOLCHAIN_DIR}:${PATH} +PATH:=$(shell cd ../../bin && pwd):$(PATH) # Select test set -ifeq (${DG_TOOLNAME},gcc) - DG_TESTS=$(DG_C_TESTS) +ifeq ($(DG_TOOLNAME),gcc) + DG_TESTS:=$(DG_C_TESTS) endif -ifeq (${DG_TOOLNAME},g++) - DG_TESTS=$(DG_CPP_TESTS) +ifeq ($(DG_TOOLNAME),g++) + DG_TESTS:=$(DG_CPP_TESTS) endif # Check that we have 'runtest' installed RUNTEST=$(shell which runtest) -ifeq "${RUNTEST}" "" +ifeq ($(RUNTEST),) $(error "DejaGnu 'runtest' not found - please install (eg. apt-get install dejagnu)") endif # Targets all: test -gcc-testsuite-${DG_GCC_VERSION}.tar.gz: -# wget -nc ${DG_GCC_URL} - -gcc-${DG_GCC_VERSION}: gcc-testsuite-${DG_GCC_VERSION}.tar.gz -# tar xzf gcc-testsuite-${DG_GCC_VERSION}.tar.gz +$(LOGDIR): + @mkdir -p $@ -config: - @mkdir -p ${TMPDIR} - @{ echo 'lappend boards_dir "."'; \ - echo "set target_alias ${DG_TARGET}"; } > ${TMPDIR}/site.exp +$(LOGDIR)/site.exp: $(TOPDIR)/default.cfg $(LOGDIR) + @{ echo 'lappend boards_dir "$(LOGDIR)"'; \ + echo "set target_alias $(TARGET)"; } > $@ + +$(LOGDIR)/board.exp: $(TOPDIR)/default.cfg $(LOGDIR) @{ echo -e "load_generic_config \"unix\""; \ echo -e "process_multilib_options \"\"" ; \ echo "set_board_info bmk,use_alarm 1" ; \ echo "set_board_info rsh_prog ssh" ; \ echo "set_board_info rcp_prog scp" ; \ - echo "set_board_info hostname ${DG_TARGET_HOSTNAME}"; \ - echo "set_board_info username ${DG_TARGET_USERNAME}"; } > ${TMPDIR}/board.exp + echo "set_board_info hostname $(DG_TARGET_HOSTNAME)"; \ + echo "set_board_info username $(DG_TARGET_USERNAME)"; } > $@ -test: gcc-${DG_GCC_VERSION} config - cd ${TMPDIR} && \ - runtest --tool ${DG_TOOLNAME} \ - --srcdir ${DG_SRC_DIR} \ - --all \ - --target ${DG_TARGET} \ - --target_board board \ - ${DG_TESTS} \ - GXX_UNDER_TEST=${DG_TARGET}-g++ ; \ - mv ${TMPDIR}/*.log ${TOPDIR} ; \ - mv ${TMPDIR}/*.sum ${TOPDIR} +# As Martin puts it: +# > The thing is that when you run 50k+ test cases the odds are that at +# > least one will fail and thus runtest basically always return an error +# > despite the fact that the test session has executed successfully. +# So just ignore any error reported by runtest +test: $(LOGDIR)/board.exp $(LOGDIR)/site.exp $(LOGDIR) + @runtest --tool $(DG_TOOLNAME) \ + --srcdir $(TOPDIR)/testsuite \ + --objdir $(LOGDIR) \ + --outdir $(LOGDIR) \ + --all \ + --target $(TARGET) \ + --target_board board \ + $(DG_TESTS) \ + GXX_UNDER_TEST=$(DG_TARGET)-g++ || true + @printf "Result files available in '%s'\n" "$(LOGDIR)" clean: - rm -rf gcc-testsuite-${DG_GCC_VERSION}.tar.gz gcc-${DG_GCC_VERSION} ${TMPDIR} *.log *.sum + rm -rf $(LOGDIR) .PHONY: config test clean