summaryrefslogtreecommitdiff
path: root/tcwg-benchmark.sh
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2021-06-19 08:00:51 +0000
committerMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2021-06-19 08:00:51 +0000
commitfc0f9d6cb3bd9d8fd845c13f8271235fc9b6a95c (patch)
tree3a529973eaa5c71bd3e01416a47ccf6ae40ff2bb /tcwg-benchmark.sh
parent3a8c432e436c6a8ab7d4681f0a105afd84145118 (diff)
tcwg-benchmark.sh: Update parameter handling
Change-Id: Id741296cb5d7f68a21a3e83a5d0dcca04f97300c
Diffstat (limited to 'tcwg-benchmark.sh')
-rwxr-xr-xtcwg-benchmark.sh71
1 files changed, 46 insertions, 25 deletions
diff --git a/tcwg-benchmark.sh b/tcwg-benchmark.sh
index 2ded4a8f..1422339a 100755
--- a/tcwg-benchmark.sh
+++ b/tcwg-benchmark.sh
@@ -2,39 +2,60 @@
# Clean: shellcheck -e 2001 ./tcwg-benchmark.sh
-set -ex
+set -eux
scripts=$(dirname "$0")
+# shellcheck source=jenkins-helpers.sh
+. $scripts/jenkins-helpers.sh
+
+convert_args_to_variables "$@"
+obligatory_variables \
+ boardname \
+ image_arch \
+ toolchain_url \
+ bench_list \
+ cflags \
+ ldflags \
+ extension \
+ testmode \
+ iterations \
+ run_profile \
+ sysroot \
+ forceinstall \
+ builder \
+ results_id \
+ BUILD_NUMBER \
+ WORKSPACE \
+ reboot \
+ ignore_errors \
+ clean_older_than
+declare -g \
+ boardname \
+ image_arch \
+ toolchain_url \
+ bench_list \
+ cflags \
+ ldflags \
+ extension \
+ testmode \
+ iterations \
+ run_profile \
+ sysroot \
+ forceinstall \
+ builder \
+ results_id \
+ BUILD_NUMBER \
+ WORKSPACE \
+ reboot \
+ ignore_errors \
+ clean_older_than
+
# Make shellcheck happy and workaround Jenkins not defining variables
# for empty arguments.
bench_container_tag="${bench_container_tag-bionic}"
-boardname="$boardname"
build_container_tag="${build_container_tag-bionic}"
-image_arch="$image_arch"
-toolchain_url="$toolchain_url"
toolchain_type="${toolchain_type-auto}"
-bench_list="$bench_list"
-cflags="$cflags"
-ldflags="$ldflags"
-extension="$extension"
-testmode="$testmode"
-iterations="$iterations"
-run_profile="$run_profile"
-sysroot="$sysroot"
-fileserver="$fileserver"
-forceinstall="$forceinstall"
-builder="$builder"
-results_id="$results_id"
-BUILD_NUMBER="$BUILD_NUMBER"
-WORKSPACE="$WORKSPACE"
-reboot="$reboot"
prepare_board="${prepare_board-true}"
-ignore_errors="$ignore_errors"
-clean_older_than="$clean_older_than"
-
-# Jenkins doesn't define variables when parameter value is empty (like cflags),
-# so enable "set -u" only after above binding of variables.
-set -u
if echo "$builder" | grep -q ".*-[0-9]\+"; then
docker_host_opt="--arch amd64 --node $builder"