1 # Helper makefile which downloads (if required) and runs the GCC test suite (DejaGnu)
3 # Note: Before run please make sure to have your toolchain available in your path.
5 # Copyright 2010 DoréDevelopment
7 # Author: Martin Lund <mgl@doredevelopment.dk>
9 # This program is free software; you can redistribute it and/or modify it
10 # under the terms of the GNU General Public License as published by the
11 # Free Software Foundation; either version 2 of the License, or (at your
12 # option) any later version.
15 # Internal directory configuration
19 # Include default configuration
22 # Add toolchain to path
23 PATH:=${DG_TOOLCHAIN_DIR}:${PATH}
26 ifeq (${DG_TOOLNAME},gcc)
27 DG_TESTS=$(DG_C_TESTS)
29 ifeq (${DG_TOOLNAME},g++)
30 DG_TESTS=$(DG_CPP_TESTS)
33 # Check that we have 'runtest' installed
34 RUNTEST=$(shell which runtest)
36 $(error "DejaGnu 'runtest' not found - please install (eg. apt-get install dejagnu)")
42 gcc-testsuite-${DG_GCC_VERSION}.tar.gz:
43 # wget -nc ${DG_GCC_URL}
45 gcc-${DG_GCC_VERSION}: gcc-testsuite-${DG_GCC_VERSION}.tar.gz
46 # tar xzf gcc-testsuite-${DG_GCC_VERSION}.tar.gz
50 @{ echo 'lappend boards_dir "."'; \
51 echo "set target_alias ${DG_TARGET}"; } > ${TMPDIR}/site.exp
52 @{ echo -e "load_generic_config \"unix\""; \
53 echo -e "process_multilib_options \"\"" ; \
54 echo "set_board_info bmk,use_alarm 1" ; \
55 echo "set_board_info rsh_prog ssh" ; \
56 echo "set_board_info rcp_prog scp" ; \
57 echo "set_board_info hostname ${DG_TARGET_HOSTNAME}"; \
58 echo "set_board_info username ${DG_TARGET_USERNAME}"; } > ${TMPDIR}/board.exp
60 test: gcc-${DG_GCC_VERSION} config
62 runtest --tool ${DG_TOOLNAME} \
63 --srcdir ${DG_SRC_DIR} \
65 --target ${DG_TARGET} \
66 --target_board board \
68 GXX_UNDER_TEST=${DG_TARGET}-g++ ; \
69 mv ${TMPDIR}/*.log ${TOPDIR} ; \
70 mv ${TMPDIR}/*.sum ${TOPDIR}
73 rm -rf gcc-testsuite-${DG_GCC_VERSION}.tar.gz gcc-${DG_GCC_VERSION} ${TMPDIR} *.log *.sum
75 .PHONY: config test clean