diff options
author | David Spickett <david.spickett@linaro.org> | 2020-05-13 14:27:20 +0100 |
---|---|---|
committer | David Spickett <david.spickett@linaro.org> | 2020-05-14 14:33:09 +0000 |
commit | b3334e58e24ea4ade3088c620dec315e62042754 (patch) | |
tree | c63901b67c695c61245ce88f8c407567ed3aba70 /tcwg_bmk-build.sh | |
parent | f362d7f03b41898cb77901b01afab5efbf59016c (diff) |
tcwg_bmk/round-robin: Add assert_with_msg function
This acts like assert but prints a message
if the assert fails. This will be visible in
the Jenkins logs and give us a unique string
to look for in the abscence of traceback for
shell scripts.
Two instances of returning false in check_regression
have had echos added to them, instead of asserts.
This is because they are not hard failures,
and may be handled by the caller. (run_step)
I have only converted the tcwg-bmk relevant
scripts to assert_with_msg so far, as a proof
of concept.
Change-Id: I3b1badf09e4856c80b973ca8b23088626ed66b0a
Diffstat (limited to 'tcwg_bmk-build.sh')
-rwxr-xr-x | tcwg_bmk-build.sh | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tcwg_bmk-build.sh b/tcwg_bmk-build.sh index 19ae14cc..bd66fe67 100755 --- a/tcwg_bmk-build.sh +++ b/tcwg_bmk-build.sh @@ -90,7 +90,7 @@ case "${rr[toolchain]}" in rr[components]="binutils gcc glibc llvm" ;; gnu) rr[components]="binutils gcc glibc" ;; - *) assert false ;; + *) assert_wth_msg "Unkown toolchain \"${rr[toolchain]}\"" false ;; esac # Use baseline branches by default. @@ -118,12 +118,15 @@ case "${rr[mode]}" in default_finish_at="update_baseline" ;; "bisect") - case "$(print_single_updated_component)" in + single_updated_component="$(print_single_updated_component)" + case $single_updated_component in binutils) default_start_at="build_abe-binutils" ;; gcc) default_start_at="build_abe-stage1" ;; glibc) default_start_at="build_abe-glibc" ;; llvm) default_start_at="build_llvm-true" ;; - *) assert false ;; + *) assert_with_msg \ + "Invalid single updated component \"$single_updated_component\"" false + ;; esac default_finish_at="check_regression" ;; @@ -232,7 +235,8 @@ benchmark () local build_num build_num=$(cat $run_step_artifacts/benchmark-start.log \ | sed -e "s/.*#\([0-9]\+\).*/\1/") - assert [ "$build_num" -gt "0" ] + assert_with_msg "Benchamark build number should not be 0!" \ + [ "$build_num" -gt "0" ] local build_status while true; do |