scripts/build/test_suite.sh
author Martin Lund <mgl@doredevelopment.dk>
Wed May 19 17:53:04 2010 +0200 (2010-05-19)
changeset 1965 e3d532dd8b5d
permissions -rw-r--r--
test-suite: Added new test suite feature (experimental)

This patch adds support for installing the gcc test suite. A helper
Makefile is provided for building and running the gcc tests.

The default configuration runs all gcc tests and requires automatic
ssh/scp login access to a networked target board. See README for
more details.

Note: Current feature is tested with the powerpc-unknown-linux-gnu
sample but it should work with others as well.

Signed-off-by: Martin Lund <mgl@doredevelopment.dk>
mgl@1965
     1
# Wrapper to build the test suite facilities
mgl@1965
     2
#
mgl@1965
     3
# Current assumption: test suites are independent of each other
mgl@1965
     4
#                     - no order handling required.
mgl@1965
     5
mgl@1965
     6
# List all test suite facilities, and parse their scripts
mgl@1965
     7
CT_TEST_SUITE_FACILITY_LIST=
mgl@1965
     8
for f in "${CT_LIB_DIR}/scripts/build/test_suite/"*.sh; do
mgl@1965
     9
    _f="$(basename "${f}" .sh)"
mgl@1965
    10
    __f="CT_TEST_SUITE_${_f}"
mgl@1965
    11
    __f=`echo ${__f} | tr "[:lower:]" "[:upper:]"`
mgl@1965
    12
    if [ "${!__f}" = "y" ]; then
mgl@1965
    13
        CT_DoLog DEBUG "Enabling test suite '${_f}'"
mgl@1965
    14
        . "${f}"
mgl@1965
    15
        CT_TEST_SUITE_FACILITY_LIST="${CT_TEST_SUITE_FACILITY_LIST} ${_f}"
mgl@1965
    16
    else
mgl@1965
    17
        CT_DoLog DEBUG "Disabling test suite '${_f}'"
mgl@1965
    18
    fi
mgl@1965
    19
done
mgl@1965
    20
mgl@1965
    21
# Download the test suite facilities
mgl@1965
    22
do_test_suite_get() {
mgl@1965
    23
    for f in ${CT_TEST_SUITE_FACILITY_LIST}; do
mgl@1965
    24
        do_test_suite_${f}_get
mgl@1965
    25
    done
mgl@1965
    26
}
mgl@1965
    27
mgl@1965
    28
# Extract and patch the test suite facilities
mgl@1965
    29
do_test_suite_extract() {
mgl@1965
    30
    for f in ${CT_TEST_SUITE_FACILITY_LIST}; do
mgl@1965
    31
        do_test_suite_${f}_extract
mgl@1965
    32
    done
mgl@1965
    33
}
mgl@1965
    34
mgl@1965
    35
# Build the test suite facilities
mgl@1965
    36
do_test_suite() {
mgl@1965
    37
    for f in ${CT_TEST_SUITE_FACILITY_LIST}; do
mgl@1965
    38
        do_test_suite_${f}_build
mgl@1965
    39
    done
mgl@1965
    40
}
mgl@1965
    41