summaryrefslogtreecommitdiff
path: root/contrib/gcc-test-suite
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/gcc-test-suite')
-rw-r--r--contrib/gcc-test-suite/Makefile75
-rw-r--r--contrib/gcc-test-suite/README71
-rw-r--r--contrib/gcc-test-suite/default.cfg17
3 files changed, 163 insertions, 0 deletions
diff --git a/contrib/gcc-test-suite/Makefile b/contrib/gcc-test-suite/Makefile
new file mode 100644
index 0000000..96b954d
--- /dev/null
+++ b/contrib/gcc-test-suite/Makefile
@@ -0,0 +1,75 @@
+# Helper makefile which downloads (if required) and runs the GCC test suite (DejaGnu)
+#
+# Note: Before run please make sure to have your toolchain available in your path.
+#
+# Copyright 2010 DoréDevelopment
+#
+# Author: Martin Lund <mgl@doredevelopment.dk>
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 2 of the License, or (at your
+# option) any later version.
+#
+
+# Internal directory configuration
+TOPDIR=${shell pwd}
+TMPDIR=${TOPDIR}/tmp
+
+# Include default configuration
+include default.cfg
+
+# Add toolchain to path
+PATH:=${DG_TOOLCHAIN_DIR}:${PATH}
+
+# Select test set
+ifeq (${DG_TOOLNAME},gcc)
+ DG_TESTS=$(DG_C_TESTS)
+endif
+ifeq (${DG_TOOLNAME},g++)
+ DG_TESTS=$(DG_CPP_TESTS)
+endif
+
+# Check that we have 'runtest' installed
+RUNTEST=$(shell which 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
+
+config:
+ @mkdir -p ${TMPDIR}
+ @{ echo 'lappend boards_dir "."'; \
+ echo "set target_alias ${DG_TARGET}"; } > ${TMPDIR}/site.exp
+ @{ 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
+
+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}
+
+clean:
+ rm -rf gcc-testsuite-${DG_GCC_VERSION}.tar.gz gcc-${DG_GCC_VERSION} ${TMPDIR} *.log *.sum
+
+.PHONY: config test clean
diff --git a/contrib/gcc-test-suite/README b/contrib/gcc-test-suite/README
new file mode 100644
index 0000000..99d61cc
--- /dev/null
+++ b/contrib/gcc-test-suite/README
@@ -0,0 +1,71 @@
+
+Helper Makefile for testing gcc toolchains using the gcc-testsuite
+==================================================================
+
+Requirements
+------------
+
+* DejaGnu 'runtest' v1.4.4+
+* Make v3.81+
+* wget
+
+
+Configuration
+-------------
+
+Edit default.cfg to reflect your toolchain and target configuration.
+
+Alternatively, override configuration variables on the command line.
+
+Available config variables:
+
+DG_GCC_VERSION
+DG_GCC_URL
+DG_TOOLNAME
+DG_TARGET
+DG_TARGET_HOSTNAME
+DG_TARGET_USERNAME
+DG_C_TESTS
+DG_CPP_TESTS
+DG_TOOLCHAIN_DIR
+DG_SRC_DIR
+
+
+Run examples
+------------
+
+The first two examples require a networked target with ssh access and automatic
+ssh login (see section below). Target SW should be compiled with the toolchain
+to be tested.
+
+Run default gcc compile/execution tests:
+$ make DG_TOOLNAME=gcc DG_TARGET_HOSTNAME=192.168.17.93 DG_TARGET_USERNAME=root
+
+Run default g++ compile/execution tests:
+$ make DG_TOOLNAME=g++ DG_TARGET_HOSTNAME=192.168.17.93 DG_TARGET_USERNAME=root
+
+Run selected gcc compile only tests (no target required):
+$ make DG_TOOLNAME=gcc DG_C_TESTS="compile.exp noncompile.exp"
+
+
+SSH automatic login configuration example
+-----------------------------------------
+
+On host do:
+ssh-keygen -t rsa (then simply press enter thru all steps)
+scp ~/.ssh/id_rsa.pub <username>@<target IP>:~/
+
+On target do:
+cd ~
+mkdir .ssh
+cat id_rsa.pub >> .ssh/authorized_keys
+rm id_rsa.pub
+
+Now automatic ssh login should work - test by doing a simple ssh session to target.
+
+Note: The procedure might be slightly different for your particular target.
+
+
+Author
+------
+Martin Lund <mgl@doredevelopment.dk>
diff --git a/contrib/gcc-test-suite/default.cfg b/contrib/gcc-test-suite/default.cfg
new file mode 100644
index 0000000..d9e2bfe
--- /dev/null
+++ b/contrib/gcc-test-suite/default.cfg
@@ -0,0 +1,17 @@
+# Default test suite configuration
+
+# GCC configuration
+DG_GCC_VERSION = 4.3.2
+DG_GCC_URL = ftp://gcc.gnu.org/pub/gcc/releases/gcc-${DG_GCC_VERSION}/gcc-testsuite-${DG_GCC_VERSION}.tar.gz
+
+# Default DejaGnu configuration
+DG_TOOLNAME = gcc
+DG_TARGET_HOSTNAME = 127.0.0.1
+DG_TARGET_USERNAME = root
+DG_TARGET = powerpc-unknown-linux-gnu
+DG_SRC_DIR = ${TOPDIR}/gcc-${DG_GCC_VERSION}/gcc/testsuite
+DG_TOOLCHAIN_DIR = ${TOPDIR}/../../bin
+
+# Default tests
+DG_C_TESTS =
+DG_CPP_TESTS =