[coreboot-gerrit] New patch to review for coreboot: Add junit.xml code to top Makefile.inc instead of utils

Martin Roth (martinroth@google.com) gerrit at coreboot.org
Thu Oct 15 22:33:40 CEST 2015


Martin Roth (martinroth at google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/11910

-gerrit

commit 4421d3f91d1c625fb4387a575546b948822ab215
Author: Martin Roth <martinroth at google.com>
Date:   Thu Oct 15 14:33:31 2015 -0600

    Add junit.xml code to top Makefile.inc instead of utils
    
    Instead of adding code to generate the junit.xml file for jenkins to
    each of the util makefiles, add it once to the top level Makefile.inc.
    
    Create a list of tools to run the test on.
    Add nvramtool and inteltool to the list of utilities tested
    
    Note that the util builds depend on implicit rules, so MFLAGS and
    MAKEFLAGS have to be cleared to get the builds to work.
    
    Change-Id: Id7ee5ea41ce3bf4a40fb50942ae785bb838fa639
    Signed-off-by: Martin Roth <martinroth at google.com>
---
 Makefile.inc | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/Makefile.inc b/Makefile.inc
index 0053dfb..dab5810 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -698,10 +698,29 @@ board_id-type := raw
 $(obj)/board_id:
 	printf $(CONFIG_BOARD_ID_STRING) > $@
 
+junit.xml:
+	echo '<?xml version="1.0" encoding="utf-8"?><testsuite>' > $@.tmp
+	$(MAKE) -C "util/$(UTIL)" distclean > /dev/null 2>&1
+	echo "<testcase classname='$(UTIL)' name='$(UTIL)'>" >> $@.tmp
+	$(MAKE) -C "util/$(UTIL)" >> $@.tmp.2 2>&1 && type="system-out" || type="failure"; \
+	if [ "$$type" = "failure" ]; then \
+		echo "<failure type='buildFailed'>" >> $@.tmp; \
+	else \
+		echo "<$$type>" >> $@.tmp; \
+	fi
+	echo '<![CDATA[' >> $@.tmp
+	cat $@.tmp.2 >> $@.tmp
+	echo "]]></$$type>" >>$@.tmp
+	rm -f $@.tmp.2
+	echo "</testcase>" >> $@.tmp
+	echo "</testsuite>" >> $@.tmp
+	mv $@.tmp "util/$(UTIL)/$@"
+
+TOOLLIST=cbmem nvramtool inteltool
 JENKINS_PAYLOAD?=none
 CPUS?=4
 what-jenkins-does:
 	util/abuild/abuild -B -J $(if $(JENKINS_NOCCACHE),,-y) -c $(CPUS) -z -p $(JENKINS_PAYLOAD) -x -X $(top)/abuild-chromeos.xml
 	util/abuild/abuild -B -J $(if $(JENKINS_NOCCACHE),,-y) -c $(CPUS) -z -p $(JENKINS_PAYLOAD)
 	(cd payloads/libpayload; unset COREBOOT_BUILD_DIR; $(MAKE) $(if $(JENKINS_NOCCACHE),,CONFIG_LP_CCACHE=y) V=$(V) Q=$(Q) junit.xml)
-	$(MAKE) V=$(V) Q=$(Q) -C util/cbmem junit.xml
+	$(foreach tool, $(TOOLLIST), $(MAKE) V=$(V) Q=$(Q) UTIL="$(tool)" MFLAGS= MAKEFLAGS= junit.xml; )



More information about the coreboot-gerrit mailing list