From 270ba9bb592c8ed2a086875de9f495cb6967f480 Mon Sep 17 00:00:00 2001 From: Chase Qi Date: Fri, 13 Jan 2017 19:13:49 +0800 Subject: automated: linux: fix toolchain smoke test on OE Change-Id: I182c3ec136ab83407367a20a358ad15070c76b98 Signed-off-by: Chase Qi --- automated/linux/toolchain-smoke/toolchain-smoke.sh | 23 ++++++++-------------- .../linux/toolchain-smoke/toolchain-smoke.yaml | 1 + 2 files changed, 9 insertions(+), 15 deletions(-) (limited to 'automated/linux') diff --git a/automated/linux/toolchain-smoke/toolchain-smoke.sh b/automated/linux/toolchain-smoke/toolchain-smoke.sh index 17b30f8..2dc76ed 100755 --- a/automated/linux/toolchain-smoke/toolchain-smoke.sh +++ b/automated/linux/toolchain-smoke/toolchain-smoke.sh @@ -1,5 +1,6 @@ #!/bin/sh -e +# shellcheck disable=SC1091 . ../../lib/sh-test-lib OUTPUT="$(pwd)/output" RESULT_FILE="${OUTPUT}/result.txt" @@ -23,34 +24,26 @@ install() { dist_name # shellcheck disable=SC2154 case "${dist}" in - Debian|Ubuntu) - pkgs="build-essential" - install_deps "${pkgs}" - ;; - Fedora|CentOS) - pkgs="gcc glibc-static" - install_deps "${pkgs}" - ;; - *) error_msg "Unsupported distribution" ;; + Debian|Ubuntu) install_deps "build-essential" "${SKIP_INSTALL}" ;; + Fedora|CentOS) install_deps "gcc glibc-static" "${SKIP_INSTALL}" ;; + Unknown) warn_msg "Unsupported distro: package install skipped" ;; esac } ! check_root && error_msg "You need to be root to run this script." [ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)" mkdir -p "${OUTPUT}" +cd "${OUTPUT}" + +install -if [ "${SKIP_INSTALL}" = "True" ] || [ "${SKIP_INSTALL}" = "true" ]; then - info_msg "gcc package installation skipped" -else - install -fi FLAGS="" if [ "${STATIC}" = "true" ] || [ "${STATIC}" = "True" ]; then FLAGS="-static" fi skip_list="execute_binary" -command="gcc ${FLAGS} -o hello hello.c" +command="gcc ${FLAGS} -o hello ../hello.c" run_test_case "${command}" "gcc${FLAGS}" "${skip_list}" command="./hello | grep -x 'Hello world'" diff --git a/automated/linux/toolchain-smoke/toolchain-smoke.yaml b/automated/linux/toolchain-smoke/toolchain-smoke.yaml index 8d7c1ab..a9d6481 100644 --- a/automated/linux/toolchain-smoke/toolchain-smoke.yaml +++ b/automated/linux/toolchain-smoke/toolchain-smoke.yaml @@ -9,6 +9,7 @@ metadata: - ubuntu - fedora - centos + - openembedded scope: - functional devices: -- cgit v1.2.3