summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorMartin Roth <martinroth@google.com>2016-12-14 10:16:26 -0700
committerMartin Roth <martinroth@google.com>2017-01-09 18:26:38 +0100
commit047c2f44b00c49f32d7eb7eb111d83dee882218f (patch)
tree88f82d7b5eb746eb448451236ac7bc4cbc6fba22 /util
parente6bd18f6b527ed7760de097e528d47d9d5865734 (diff)
util/abuild: Print list of failed boards at the end of the abuild
When running abuild outside of jenkins, because all of the builds are printed intermixed, it's easy to miss when a board has failed the build by looking at the output. This saves a list of failed builds and prints the list at the end of the run. - Add a command line option to mark when abuild is being called recursively. - Add all failed builds to a list. - Print the list when a non-recursive abuild run exits. Change-Id: Icb40ed8083a57bbcde49297d2b0814f98dcbb6c8 Signed-off-by: Martin Roth <martinroth@google.com> Reviewed-on: https://review.coreboot.org/17890 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber <nico.h@gmx.de>
Diffstat (limited to 'util')
-rwxr-xr-xutil/abuild/abuild29
1 files changed, 26 insertions, 3 deletions
diff --git a/util/abuild/abuild b/util/abuild/abuild
index 7c4e29fcbf..93ceac50e9 100755
--- a/util/abuild/abuild
+++ b/util/abuild/abuild
@@ -79,6 +79,9 @@ quiet=false
# clang mode enabled by -sb option.
scanbuild=false
+# Mark whether abuild was called recursively
+recursive=false
+
trap interrupt INT
function interrupt
@@ -359,6 +362,7 @@ function compile_target
printf "failed\n" > compile.status
printf "%s build FAILED after %ss!\nLog excerpt:\n" "$BUILD_NAME" "${duration}"
tail -n $CONTEXT make.log 2> /dev/null || tail -$CONTEXT make.log
+ echo "$BUILD_NAME" >> "$FAILED_BOARDS"
failed=1
fi
cd "$CURR" || return $?
@@ -424,6 +428,7 @@ function build_config
tail -n $CONTEXT "$build_dir/config.log" 2> /dev/null || tail -$CONTEXT "$build_dir/config.log"
junit "</testcase>"
+ echo "$BUILD_NAME" >> "$FAILED_BOARDS"
return
fi
@@ -585,12 +590,12 @@ getoptbrand="$(getopt -V)"
# shellcheck disable=SC2086
if [ "${getoptbrand:0:6}" == "getopt" ]; then
# Detected GNU getopt that supports long options.
- args=$(getopt -l version,verbose,quiet,help,all,target:,payloads:,cpus:,silent,junit,config,loglevel:,remove,prefix:,update,scan-build,ccache,blobs,clang,clean,outdir:,chromeos,xmlfile:,kconfig:,dir:,root: -o Vvqhat:p:c:sJCl:rP:uyBLzo:xX:K:d:R: -- "$@") || exit 1
+ args=$(getopt -l version,verbose,quiet,help,all,target:,payloads:,cpus:,silent,junit,config,loglevel:,remove,prefix:,update,scan-build,ccache,blobs,clang,clean,outdir:,chromeos,xmlfile:,kconfig:,dir:,root:,recursive -o Vvqhat:p:c:sJCl:rP:uyBLzo:xX:K:d:R:I -- "$@") || exit 1
eval set -- $args
retval=$?
else
# Detected non-GNU getopt
- args=$(getopt Vvqhat:p:c:sJCl:rP:uyBLzo:xX:K:d:R: "$@")
+ args=$(getopt Vvqhat:p:c:sJCl:rP:uyBLzo:xX:K:d:R:I "$@")
set -- $args
retval=$?
fi
@@ -671,6 +676,7 @@ while true ; do
configoptions="${configoptions}CONFIG_CHROMEOS=y\n"
;;
-X|--xmlfile) shift; XMLFILE=$1; REAL_XMLFILE=$1; shift;;
+ -I|--recursive) shift; recursive=true;;
-K|--kconfig) shift
testclass="$(basename "$1" | tr '.' '_' )"
customizing="${customizing}, $1 config"
@@ -695,6 +701,12 @@ if [ "$customizing" = "" ]; then
customizing="default configuration"
fi
+FAILED_BOARDS="$TOP/$TARGET/failed_boards"
+
+if [ "$recursive" = "false" ]; then
+ rm -f "$FAILED_BOARDS"
+fi
+
USE_XARGS=0
if [ "$cpus" != "1" ]; then
# Limit to 32 parallel builds for now.
@@ -770,7 +782,7 @@ build_targets()
fi
rm -rf "$TARGET/temp" "$TMPCFG"
# shellcheck disable=SC2086
- echo $targets | xargs -P ${cpus:-0} -n 1 "$0" $cmdline -t
+ echo $targets | xargs -P ${cpus:-0} -n 1 "$0" $cmdline -I -t
}
fi
@@ -814,4 +826,15 @@ else
fi
junit '</testsuite>'
+if [ "$recursive" = "false" ]; then
+
+ # Print the list of failed boards
+ if [ -f "$FAILED_BOARDS" ]; then
+ printf "%s build(s) failed:\n" "$( wc -l < "$FAILED_BOARDS" )"
+ cat "$FAILED_BOARDS"
+ else
+ echo "All tested boards passed."
+ fi
+fi
+
exit $failed