summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Georgi <patrick@georgi-clan.de>2013-12-05 19:36:31 +0100
committerAlexandru Gagniuc <mr.nuke.me@gmail.com>2013-12-07 03:33:38 +0100
commit6f0e160459aa7d1de34da85978df5f3282c973ce (patch)
tree12883dfa4258bc4e077839b0382c22de822d8967
parentb17117904d1c233bc0798022f17b4ef38393fffc (diff)
abuild: drop xml mode
We use junit style output these days. Change-Id: I4110ec10bf0e9f4354ee08e7e1c5a81ae605fee0 Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/4484 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
-rwxr-xr-xutil/abuild/abuild74
1 files changed, 4 insertions, 70 deletions
diff --git a/util/abuild/abuild b/util/abuild/abuild
index 706bb2a7e3..18f39c3d51 100755
--- a/util/abuild/abuild
+++ b/util/abuild/abuild
@@ -60,7 +60,7 @@ if [ "$i" = "nonexistant_make" ]; then
fi
MAKE=$i
-# this can be changed to xml by -x
+# this can be changed to junit by -J
mode=text
# silent mode.. no compiler calls, only warnings in the log files.
@@ -83,7 +83,7 @@ trap interrupt INT
function interrupt
{
printf "\n$0: execution interrupted manually.\n"
- if [ "$mode" == "xml" ]; then
+ if [ "$mode" == "junit" ]; then
printf "$0: deleting incomplete xml output file.\n"
fi
exit 1
@@ -94,21 +94,6 @@ function debug
test "$verbose" == "true" && printf "$*\n"
}
-function xml
-{
- test "$mode" == "xml" && printf "$*\n" >> $XMLFILE
- return 0
-}
-
-function xmlfile
-{
- test "$mode" == "xml" && {
- printf '<![CDATA[\n'
- cat $1
- printf ']]>\n'
- } >> $XMLFILE
-}
-
function junit
{
test "$mode" == "junit" && printf "$*\n" >> $XMLFILE
@@ -181,11 +166,9 @@ function create_config
if [ "$CONFIG" != "" ]; then
printf " Using existing configuration $CONFIG ... "
- xml " <config>$CONFIG</config>"
cp src/mainboard/$VENDOR/$MAINBOARD/$CONFIG ${build_dir}/config.build
else
printf " Creating config file... "
- xml " <config>autogenerated</config>"
grep "if[\t ]*VENDOR" src/mainboard/$VENDOR/$MAINBOARD/../Kconfig | \
sed "s,^.*\(VENDOR_.*\)[^A-Z0-9_]*,CONFIG_\1=y," > ${build_dir}/config.build
grep "if[\t ]*BOARD" src/mainboard/$VENDOR/$MAINBOARD/Kconfig | \
@@ -210,20 +193,10 @@ function create_config
ret=$?
if [ $ret -eq 0 ]; then
printf "ok; "
- xml " <builddir>ok</builddir>"
- xml " <log>"
- xmlfile $build_dir/config.log
- xml " </log>"
- xml ""
return 0
else
# Does this ever happen?
printf "FAILED!\nLog excerpt:\n"
- xml " <builddir>failed</builddir>"
- xml " <log>"
- xmlfile $build_dir/config.log
- xml " </log>"
- xml ""
tail -n $CONTEXT $build_dir/config.log 2> /dev/null || tail -$CONTEXT $build_dir/config.log
return 1
fi
@@ -274,15 +247,9 @@ function compile_target
etime=`perl -e 'print time();' 2>/dev/null || date +%s`
duration=$(( $etime - $stime ))
- xml " <buildtime>${duration}s</buildtime>"
junit " <testcase classname='board' name='$TARCH/$VENDOR/$MAINBOARD' time='$duration' >"
- xml " <log>"
- xmlfile make.log
- xml " </log>"
-
if [ $ret -eq 0 ]; then
- xml " <compile>ok</compile>"
junit "<system-out>"
junitfile make.log
junit "</system-out>"
@@ -291,7 +258,6 @@ function compile_target
cd $CURR
return 0
else
- xml " <compile>failed</compile>"
junit "<failure type='BuildFailed'>"
junitfile make.log
junit "</failure>"
@@ -338,14 +304,6 @@ function build_target
mkdir -p $TOP/$TARGET/${VENDOR}_${MAINBOARD}
XMLFILE=$TOP/$TARGET/${VENDOR}_${MAINBOARD}/abuild.xml
- xml "<mainboard>"
- xml ""
- xml " <vendor>$VENDOR</vendor>"
- xml " <device>$MAINBOARD</device>"
- xml ""
- xml " <architecture>$TARCH</architecture>"
- xml ""
-
if [ "$ARCH" = "$TARCH" -o $found_crosscompiler = true ]; then
printf "$TARCH: ok$CROSS_TEXT\n"
else
@@ -383,10 +341,6 @@ function build_target
# Check result:
if [ $found_crosscompiler == "false" ]; then
printf "$TARCH: skipped, we're $ARCH\n\n"
- xml " <status>notbuilt</status>"
- xml ""
- xml "</mainboard>"
-
junit "<testcase classname='board' name='$TARCH/$VENDOR/$MAINBOARD' >"
junit " <failure type='NoCrossCompiler'>No cross-compiler for $TARCH found</failure>"
junit "</testcase>"
@@ -394,11 +348,6 @@ function build_target
return 0
else
printf "$TARCH: ok, $ARCH using ${CROSS_COMPILE}gcc\n"
- xml " <compiler>"
- xml " <path>`which ${CROSS_COMPILE}gcc`</path>"
- xml " <version>`${CROSS_COMPILE}gcc --version | head -1`</version>"
- xml " </compiler>"
- xml ""
fi
fi
@@ -414,9 +363,7 @@ function build_target
if [ "$scanbuild" = "true" ]; then
rm -rf $TARGET/scan-build-results-tmp
fi
- compile_target $VENDOR $MAINBOARD &&
- xml " <status>ok</status>" ||
- xml "<status>broken</status>"
+ compile_target $VENDOR $MAINBOARD
if [ "$scanbuild" = "true" ]; then
rm -rf $TARGET/${VENDOR}_${MAINBOARD}-scanbuild
mv `dirname $TARGET/scan-build-results-tmp/*/index.html` $TARGET/${VENDOR}_${MAINBOARD}-scanbuild
@@ -425,10 +372,7 @@ function build_target
# Not calculated here because we still print it in compile_target
#etime=`perl -e 'print time();' 2>/dev/null || date +%s`
#duration=$(( $etime - $stime ))
- #xml " <buildtime>${duration}s</buildtime>"
- xml ""
- xml "</mainboard>"
junit "</testcase>"
printf "\n"
@@ -506,8 +450,6 @@ function myhelp
printf " [-p|--payloads <dir>] use payloads in <dir> to build images\n"
printf " [-V|--version] print version number and exit\n"
printf " [-h|--help] print this help and exit\n"
- printf " [-x|--xml] write xml log file \n"
- printf " (defaults to $XMLFILE)\n"
printf " [-J|--junit] write JUnit formatted xml log file \n"
printf " (defaults to $XMLFILE)\n"
printf " [-T|--test] submit image(s) to automated test system\n"
@@ -561,7 +503,7 @@ cmdline="$* -c 1"
getoptbrand="`getopt -V`"
if [ "${getoptbrand:0:6}" == "getopt" ]; then
# Detected GNU getopt that supports long options.
- args=`getopt -l version,verbose,help,all,target:,payloads:,test,cpus:,silent,junit,xml,config,loglevel:,remove,prefix:,update,nostackprotect,scan-build,ccache,blobs -o Vvhat:p:Tc:sJxCl:rP:uyB -- "$@"` || exit 1
+ args=`getopt -l version,verbose,help,all,target:,payloads:,test,cpus:,silent,junit,config,loglevel:,remove,prefix:,update,nostackprotect,scan-build,ccache,blobs -o Vvhat:p:Tc:sJCl:rP:uyB -- "$@"` || exit 1
eval set -- $args
else
# Detected non-GNU getopt
@@ -578,7 +520,6 @@ customizing=""
configoptions=""
while true ; do
case "$1" in
- -x|--xml) shift; mode=xml; rm -f $XMLFILE ;;
-J|--junit) shift; mode=junit; rm -f $XMLFILE ;;
-t|--target) shift; target="$1"; shift;;
-a|--all) shift; buildall=true;;
@@ -684,9 +625,6 @@ test -z "$1" || ROOT=$1
debug "ROOT=$ROOT"
-xml '<?xml version="1.0" encoding="utf-8"?>'
-xml '<abuild>'
-
junit '<?xml version="1.0" encoding="utf-8"?>'
junit '<testsuite>'
@@ -708,9 +646,6 @@ else
build_all_targets
rm -f $REAL_XMLFILE
XMLFILE=$REAL_XMLFILE
- xml '<?xml version="1.0" encoding="utf-8"?>'
- xml '<abuild>'
-
junit '<?xml version="1.0" encoding="utf-8"?>'
junit '<testsuite>'
if [ "$mode" != "text" ]; then
@@ -720,7 +655,6 @@ else
fi
XMLFILE=$REAL_XMLFILE
fi
-xml '</abuild>'
junit '</testsuite>'
exit $failed