summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/build/test_suite.sh41
-rw-r--r--scripts/build/test_suite/gcc.sh36
-rw-r--r--scripts/crosstool-NG.sh.in7
3 files changed, 84 insertions, 0 deletions
diff --git a/scripts/build/test_suite.sh b/scripts/build/test_suite.sh
new file mode 100644
index 0000000..8fabf42
--- /dev/null
+++ b/scripts/build/test_suite.sh
@@ -0,0 +1,41 @@
+# Wrapper to build the test suite facilities
+#
+# Current assumption: test suites are independent of each other
+# - no order handling required.
+
+# List all test suite facilities, and parse their scripts
+CT_TEST_SUITE_FACILITY_LIST=
+for f in "${CT_LIB_DIR}/scripts/build/test_suite/"*.sh; do
+ _f="$(basename "${f}" .sh)"
+ __f="CT_TEST_SUITE_${_f}"
+ __f=`echo ${__f} | tr "[:lower:]" "[:upper:]"`
+ if [ "${!__f}" = "y" ]; then
+ CT_DoLog DEBUG "Enabling test suite '${_f}'"
+ . "${f}"
+ CT_TEST_SUITE_FACILITY_LIST="${CT_TEST_SUITE_FACILITY_LIST} ${_f}"
+ else
+ CT_DoLog DEBUG "Disabling test suite '${_f}'"
+ fi
+done
+
+# Download the test suite facilities
+do_test_suite_get() {
+ for f in ${CT_TEST_SUITE_FACILITY_LIST}; do
+ do_test_suite_${f}_get
+ done
+}
+
+# Extract and patch the test suite facilities
+do_test_suite_extract() {
+ for f in ${CT_TEST_SUITE_FACILITY_LIST}; do
+ do_test_suite_${f}_extract
+ done
+}
+
+# Build the test suite facilities
+do_test_suite() {
+ for f in ${CT_TEST_SUITE_FACILITY_LIST}; do
+ do_test_suite_${f}_build
+ done
+}
+
diff --git a/scripts/build/test_suite/gcc.sh b/scripts/build/test_suite/gcc.sh
new file mode 100644
index 0000000..1b65269
--- /dev/null
+++ b/scripts/build/test_suite/gcc.sh
@@ -0,0 +1,36 @@
+# This file adds the functions to build the GCC test suite
+# Copyright 2010 DoréDevelopment
+# Created by Martin Lund <mgl@doredevelopment.dk>
+# Licensed under the GPL v2. See COPYING in the root of this package
+
+do_test_suite_gcc_get() { :; }
+do_test_suite_gcc_extract() { :; }
+do_test_suite_gcc_build() { :; }
+
+# Overide functions depending on configuration
+if [ "${CT_TEST_SUITE_GCC}" = "y" ]; then
+
+do_test_suite_gcc_build() {
+
+ CT_DoStep INFO "Installing GCC test suite"
+
+ CT_DoExecLog ALL mkdir -p "${CT_TEST_SUITE_DIR}/gcc-test-suite/gcc-${CT_CC_VERSION}/gcc"
+ CT_DoExecLog ALL cp "${CT_TOP_DIR}/contrib/gcc-test-suite/Makefile" \
+ "${CT_TEST_SUITE_DIR}/gcc-test-suite"
+ CT_DoExecLog ALL cp "${CT_TOP_DIR}/contrib/gcc-test-suite/default.cfg" \
+ "${CT_TEST_SUITE_DIR}/gcc-test-suite"
+ CT_DoExecLog ALL cp "${CT_TOP_DIR}/contrib/gcc-test-suite/README" \
+ "${CT_TEST_SUITE_DIR}/gcc-test-suite"
+ CT_DoExecLog ALL cp -r "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/gcc/testsuite" \
+ "${CT_TEST_SUITE_DIR}/gcc-test-suite/gcc-${CT_CC_VERSION}/gcc"
+ sed "s/DG_GCC_VERSION .*/DG_GCC_VERSION = ${CT_CC_VERSION}/g" \
+ ${CT_TEST_SUITE_DIR}/gcc-test-suite/default.cfg > \
+ ${CT_TEST_SUITE_DIR}/gcc-test-suite/default.cfg.tmp
+ sed "s/DG_TARGET .*/DG_TARGET = ${CT_TARGET}/g" \
+ ${CT_TEST_SUITE_DIR}/gcc-test-suite/default.cfg.tmp > \
+ ${CT_TEST_SUITE_DIR}/gcc-test-suite/default.cfg
+ CT_DoExecLog ALL rm -f "${CT_TEST_SUITE_DIR}/gcc-test-suite/default.cfg.tmp"
+ CT_EndStep
+}
+
+fi # CT_TEST_SUITE_GCC
diff --git a/scripts/crosstool-NG.sh.in b/scripts/crosstool-NG.sh.in
index cc54202..29ae4a1 100644
--- a/scripts/crosstool-NG.sh.in
+++ b/scripts/crosstool-NG.sh.in
@@ -125,6 +125,7 @@ CT_DoLog INFO "Building environment variables"
. "${CT_LIB_DIR}/scripts/build/libc/${CT_LIBC}.sh"
. "${CT_LIB_DIR}/scripts/build/cc/${CT_CC}.sh"
. "${CT_LIB_DIR}/scripts/build/debug.sh"
+. "${CT_LIB_DIR}/scripts/build/test_suite.sh"
# Target tuple: CT_TARGET needs a little love:
CT_DoBuildTargetTuple
@@ -159,6 +160,9 @@ else
CT_COMPLIBS_DIR="${CT_BUILD_DIR}/static"
fi
+# Compute test suite install directory
+CT_TEST_SUITE_DIR=${CT_INSTALL_DIR}/test-suite
+
# Note: we'll always install the core compiler in its own directory, so as to
# not mix the two builds: core and final.
CT_CC_CORE_STATIC_PREFIX_DIR="${CT_BUILD_DIR}/${CT_CC}-core-static"
@@ -518,6 +522,7 @@ if [ -z "${CT_RESTART}" ]; then
do_cc_get
do_libc_get
do_debug_get
+ do_test_suite_get
CT_EndStep
fi
@@ -548,6 +553,7 @@ if [ -z "${CT_RESTART}" ]; then
do_cc_extract
do_libc_extract
do_debug_extract
+ do_test_suite_extract
CT_EndStep
fi
fi
@@ -596,5 +602,6 @@ exec >/dev/null 2>&1
[ "${CT_LOG_FILE_COMPRESS}" = y ] && bzip2 -9 "${CT_LOG_FILE}"
[ "${CT_INSTALL_DIR_RO}" = "y" ] && chmod -R a-w "${CT_INSTALL_DIR}"
+[ "${CT_TEST_SUITE}" = "y" ] && chmod -R a+w "${CT_TEST_SUITE_DIR}"
trap - EXIT