contrib/gcc-test-suite/Makefile
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue Aug 31 23:24:40 2010 +0200 (2010-08-31)
branch1.8
changeset 2108 68d038933dc4
parent 1965 e3d532dd8b5d
child 2170 4f8aa694f9c0
permissions -rw-r--r--
binutils/binutils: remove faulty patch

The added code should be conditinal to the target system
being !MIPS, but is based on the host system being !MIPS.

This is plain wrong, and had not been noticed until now
as I never used those binutils versions on MIPS.

See:
http://sourceware.org/ml/crossgcc/2010-08/msg00192.html

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
(transplanted from f5ab0a80e46616adb3619cc7c5d78d0ccd7ea697)
mgl@1965
     1
# Helper makefile which downloads (if required) and runs the GCC test suite (DejaGnu)
mgl@1965
     2
#
mgl@1965
     3
# Note: Before run please make sure to have your toolchain available in your path.
mgl@1965
     4
#
mgl@1965
     5
# Copyright 2010 DoréDevelopment
mgl@1965
     6
# 
mgl@1965
     7
# Author: Martin Lund <mgl@doredevelopment.dk>
mgl@1965
     8
#
mgl@1965
     9
# This program is free software; you can redistribute  it and/or modify it
mgl@1965
    10
# under  the terms of  the GNU General  Public License as published by the
mgl@1965
    11
# Free Software Foundation;  either version 2 of the  License, or (at your
mgl@1965
    12
# option) any later version.
mgl@1965
    13
#
mgl@1965
    14
yann@1966
    15
# Internal configuration
yann@1966
    16
TARGET:=@@DG_TARGET@@
yann@1966
    17
TOPDIR:=$(shell pwd)
yann@1966
    18
LOGDIR:=$(TOPDIR)/tmp
mgl@1965
    19
mgl@1965
    20
# Include default configuration
mgl@1965
    21
include default.cfg
mgl@1965
    22
mgl@1965
    23
# Add toolchain to path
yann@1966
    24
PATH:=$(shell cd ../../bin && pwd):$(PATH)
mgl@1965
    25
mgl@1965
    26
# Select test set
yann@1966
    27
ifeq ($(DG_TOOLNAME),gcc)
yann@1966
    28
	DG_TESTS:=$(DG_C_TESTS)
mgl@1965
    29
endif
yann@1966
    30
ifeq ($(DG_TOOLNAME),g++)
yann@1966
    31
	DG_TESTS:=$(DG_CPP_TESTS)
mgl@1965
    32
endif
mgl@1965
    33
mgl@1965
    34
# Check that we have 'runtest' installed
mgl@1965
    35
RUNTEST=$(shell which runtest)
yann@1966
    36
ifeq ($(RUNTEST),)
mgl@1965
    37
        $(error "DejaGnu 'runtest' not found - please install (eg. apt-get install dejagnu)")
mgl@1965
    38
endif
mgl@1965
    39
mgl@1965
    40
# Targets 
mgl@1965
    41
all: test
mgl@1965
    42
yann@1966
    43
$(LOGDIR):
yann@1966
    44
	@mkdir -p $@
mgl@1965
    45
yann@1966
    46
$(LOGDIR)/site.exp: $(TOPDIR)/default.cfg $(LOGDIR)
yann@1966
    47
	@{ echo 'lappend boards_dir "$(LOGDIR)"'; \
yann@1966
    48
	  echo "set target_alias $(TARGET)"; } > $@
yann@1966
    49
yann@1966
    50
$(LOGDIR)/board.exp: $(TOPDIR)/default.cfg $(LOGDIR)
mgl@1965
    51
	@{ echo -e "load_generic_config \"unix\""; \
mgl@1965
    52
	echo -e "process_multilib_options \"\"" ; \
mgl@1965
    53
	echo "set_board_info bmk,use_alarm 1" ; \
mgl@1965
    54
	echo "set_board_info rsh_prog ssh" ; \
mgl@1965
    55
	echo "set_board_info rcp_prog scp" ; \
yann@1966
    56
	echo "set_board_info hostname $(DG_TARGET_HOSTNAME)"; \
yann@1966
    57
	echo "set_board_info username $(DG_TARGET_USERNAME)"; } > $@
mgl@1965
    58
yann@1966
    59
# As Martin puts it:
yann@1966
    60
#  > The thing is that when you run 50k+ test cases the odds are that at
yann@1966
    61
#  > least one will fail and thus runtest basically always return an error
yann@1966
    62
#  > despite the fact that the test session has executed successfully.
yann@1966
    63
# So just ignore any error reported by runtest
yann@1966
    64
test: $(LOGDIR)/board.exp $(LOGDIR)/site.exp $(LOGDIR)
yann@1966
    65
	@runtest --tool $(DG_TOOLNAME)          \
yann@1966
    66
	         --srcdir $(TOPDIR)/testsuite   \
yann@1966
    67
	         --objdir $(LOGDIR)             \
yann@1966
    68
	         --outdir $(LOGDIR)             \
yann@1966
    69
	         --all                          \
yann@1966
    70
	         --target $(TARGET)             \
yann@1966
    71
	         --target_board board           \
yann@1966
    72
	         $(DG_TESTS)                    \
yann@1966
    73
	         GXX_UNDER_TEST=$(DG_TARGET)-g++ || true
yann@1966
    74
	@printf "Result files available in '%s'\n" "$(LOGDIR)"
mgl@1965
    75
mgl@1965
    76
clean:
yann@1966
    77
	rm -rf $(LOGDIR)
mgl@1965
    78
mgl@1965
    79
.PHONY: config test clean