From 1fa7745f4aa0a4bea8e7f684d46daf77e77654a6 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Wed, 13 May 2020 15:11:27 -0700 Subject: [PATCH] scripts/testbench: add set -e Let's stop ignoring build and test failures. Start gradually with the scripts involved in testbench, more files later. Follow-up to to bug #2752 "host-testbench.sh ignores errors" and commit ab421466aff826 ("CI: Travis: enable host testbnech again") and ab421466aff826~1 Signed-off-by: Marc Herbert --- scripts/host-testbench.sh | 5 ++++- scripts/xtensa-build-all.sh | 8 ++++---- tools/test/audio/comp_run.sh | 3 +++ tools/test/audio/eqiir_run.sh | 5 ++++- tools/test/audio/src_run.sh | 5 ++++- tools/test/audio/volume_run.sh | 5 ++++- 6 files changed, 23 insertions(+), 8 deletions(-) diff --git a/scripts/host-testbench.sh b/scripts/host-testbench.sh index 5b9d90fffabf..306a8a26defb 100755 --- a/scripts/host-testbench.sh +++ b/scripts/host-testbench.sh @@ -11,6 +11,9 @@ # ./scripts/host-testbench.sh # +# stop on most errors +set -e + function filesize() { du -b "$1" | awk '{print $1}' } @@ -46,7 +49,7 @@ SOF_DIR=$SCRIPTS_DIR/../ TESTBENCH_DIR=${SOF_DIR}/tools/test/audio INPUT_FILE_SIZE=10240 -cd "$TESTBENCH_DIR" || exit 2 +cd "$TESTBENCH_DIR" rm -rf ./*.raw # create input zeros raw file diff --git a/scripts/xtensa-build-all.sh b/scripts/xtensa-build-all.sh index 1acd329dcabf..4bdd521a202a 100755 --- a/scripts/xtensa-build-all.sh +++ b/scripts/xtensa-build-all.sh @@ -2,6 +2,9 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2018 Intel Corporation. All rights reserved. +# stop on most errors +set -e + SUPPORTED_PLATFORMS=(byt cht bdw hsw apl skl kbl cnl sue icl jsl \ imx8 imx8x imx8m) BUILD_ROM=no @@ -55,7 +58,7 @@ for arg in "$@"; do if [ x"$i" = x"$arg" ]; then PLATFORMS=("${PLATFORMS[@]}" "$i") platform=$i - shift + shift || true break fi done @@ -84,9 +87,6 @@ then PRIVATE_KEY_OPTION="-DRIMAGE_PRIVATE_KEY=${RIMAGE_PRIVATE_KEY}" fi -# fail on any errors -set -e - OLDPATH=$PATH WORKDIR="$pwd" diff --git a/tools/test/audio/comp_run.sh b/tools/test/audio/comp_run.sh index dfb8c8f2d69d..de244588d4ae 100755 --- a/tools/test/audio/comp_run.sh +++ b/tools/test/audio/comp_run.sh @@ -2,6 +2,9 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2018-2020 Intel Corporation. All rights reserved. +# stop on most errors +set -e + COMP=$1 DIRECTION=$2 BITS_IN=$3 diff --git a/tools/test/audio/eqiir_run.sh b/tools/test/audio/eqiir_run.sh index bd0ff4989fc3..8d5737c9ec74 100755 --- a/tools/test/audio/eqiir_run.sh +++ b/tools/test/audio/eqiir_run.sh @@ -2,6 +2,9 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2020 Intel Corporation. All rights reserved. +# stop on most errors +set -e + usage () { echo "Usage: $0 " @@ -14,7 +17,7 @@ main () if [ $# -ne 5 ]; then usage "$0" - exit + exit 1 fi COMP=eq-iir diff --git a/tools/test/audio/src_run.sh b/tools/test/audio/src_run.sh index 03920012d380..93676f7c3247 100755 --- a/tools/test/audio/src_run.sh +++ b/tools/test/audio/src_run.sh @@ -2,6 +2,9 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2018-2020 Intel Corporation. All rights reserved. +# stop on most errors +set -e + usage () { echo "Usage: $1 " @@ -14,7 +17,7 @@ main() if [ $# -ne 6 ]; then usage "$0" - exit + exit 1 fi COMP=src diff --git a/tools/test/audio/volume_run.sh b/tools/test/audio/volume_run.sh index dd8308ae8c36..72daabead275 100755 --- a/tools/test/audio/volume_run.sh +++ b/tools/test/audio/volume_run.sh @@ -2,6 +2,9 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2020 Intel Corporation. All rights reserved. +# stop on most errors +set -e + usage () { echo "Usage: $0 " @@ -14,7 +17,7 @@ main () if [ $# -ne 5 ]; then usage "$0" - exit + exit 1 fi COMP=volume