<p>Martin Roth has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/26421">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">util/testing: Update junit.xml to support coreboot builds<br><br>Up to this point, junit.xml has only been used to build tools, as abuild<br>has handled the coreboot builds.  To add additional tests not covered<br>by abuild, we need junit.xml to work with bare directories.<br><br>This also requires updating the build directory (BLD_DIR) for existing<br>builds using the junit.xml target.<br><br>Change-Id: If6e27e02e25e20f48e5a9372373de6058ca378dd<br>Signed-off-by: Martin Roth <gaumless@gmail.com><br>---<br>M util/testing/Makefile.inc<br>1 file changed, 32 insertions(+), 22 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/21/26421/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/util/testing/Makefile.inc b/util/testing/Makefile.inc</span><br><span>index ff6dfde..d9bb0f7 100644</span><br><span>--- a/util/testing/Makefile.inc</span><br><span>+++ b/util/testing/Makefile.inc</span><br><span>@@ -23,30 +23,40 @@</span><br><span>       @echo  '  test-cleanup           - basic: Cleans coreboot directories'</span><br><span> </span><br><span> # junit.xml is a helper target to wrap builds that don't create junit.xml output</span><br><span style="color: hsl(0, 100%, 40%);">-# BLD = Subdirectory the build lives in - The name of the build</span><br><span style="color: hsl(120, 100%, 40%);">+# BLD = The name of the build</span><br><span> # BLD_DIR = Top path from coreboot to the build subdirectory</span><br><span> # MAKETARGET = target to build</span><br><span> junit.xml:</span><br><span>     echo "Building $(BLD)"</span><br><span>     echo '<?xml version="1.0" encoding="utf-8"?><testsuite>' > $@.tmp</span><br><span>         echo "<testcase classname='$(BLD)' name='$(BLD)'>" >> $@.tmp</span><br><span style="color: hsl(0, 100%, 40%);">-      -$(MAKE) -j $(CPUS) -C "$(BLD_DIR)$(BLD)" clean distclean > $@.tmp.2 2>&1</span><br><span style="color: hsl(0, 100%, 40%);">-   $(MAKE) -j $(CPUS) -C "$(BLD_DIR)$(BLD)" $(MAKETARGET) >> $@.tmp.2 2>&1 && type="system-out" || type="failure"; \</span><br><span style="color: hsl(0, 100%, 40%);">-    cat $@.tmp.2; \</span><br><span style="color: hsl(0, 100%, 40%);">- if [ "$$type" = "failure" ]; then \</span><br><span style="color: hsl(0, 100%, 40%);">-         echo "<failure type='buildFailed'>" >> $@.tmp; \</span><br><span style="color: hsl(0, 100%, 40%);">-          echo "Building $(BLD) Failed"; \</span><br><span style="color: hsl(0, 100%, 40%);">-      else \</span><br><span style="color: hsl(0, 100%, 40%);">-          echo "<$$type>" >> $@.tmp; \</span><br><span style="color: hsl(0, 100%, 40%);">-              echo "Building $(BLD) Succeeded"; \</span><br><span style="color: hsl(0, 100%, 40%);">-   fi; \</span><br><span style="color: hsl(0, 100%, 40%);">-   echo '<![CDATA[' >> $@.tmp; \</span><br><span style="color: hsl(0, 100%, 40%);">-  cat $@.tmp.2 >> $@.tmp; \</span><br><span style="color: hsl(0, 100%, 40%);">- echo "]]></$$type>" >>$@.tmp</span><br><span style="color: hsl(0, 100%, 40%);">-   rm -f $@.tmp.2</span><br><span style="color: hsl(0, 100%, 40%);">-  echo "</testcase>" >> $@.tmp</span><br><span style="color: hsl(0, 100%, 40%);">-      echo "</testsuite>" >> $@.tmp</span><br><span style="color: hsl(0, 100%, 40%);">-     mv $@.tmp "$(BLD_DIR)$(BLD)/$@"</span><br><span style="color: hsl(120, 100%, 40%);">+     -if [ -z "$(BLD_DIR)" ]; then                                          \</span><br><span style="color: hsl(120, 100%, 40%);">+            projdir="";                                                    \</span><br><span style="color: hsl(120, 100%, 40%);">+            xmlfile=junit_$(BLD).xml;                                      \</span><br><span style="color: hsl(120, 100%, 40%);">+      else                                                                   \</span><br><span style="color: hsl(120, 100%, 40%);">+              projdir="-C $(BLD_DIR)";                                       \</span><br><span style="color: hsl(120, 100%, 40%);">+            xmlfile="$(BLD_DIR)/$@";                                       \</span><br><span style="color: hsl(120, 100%, 40%);">+    fi;                                                                    \</span><br><span style="color: hsl(120, 100%, 40%);">+      if [ -z "$(SKIP_DISTCLEAN)" ]; then                                    \</span><br><span style="color: hsl(120, 100%, 40%);">+            $(MAKE) -j $(CPUS) $$projdir clean distclean > $@.tmp.2 2>&1 ; \</span><br><span style="color: hsl(120, 100%, 40%);">+    fi;                                                                    \</span><br><span style="color: hsl(120, 100%, 40%);">+      if $(MAKE) -j $(CPUS) $$projdir $(MAKETARGET) >> $@.tmp.2 2>&1; then   \</span><br><span style="color: hsl(120, 100%, 40%);">+         type="system-out";                                             \</span><br><span style="color: hsl(120, 100%, 40%);">+            echo "<$$type>" >> $@.tmp;                                     \</span><br><span style="color: hsl(120, 100%, 40%);">+                echo "Building $(BLD) Succeeded";                              \</span><br><span style="color: hsl(120, 100%, 40%);">+    else                                                                   \</span><br><span style="color: hsl(120, 100%, 40%);">+              type="failure";                                                \</span><br><span style="color: hsl(120, 100%, 40%);">+            echo "<failure type='buildFailed'>" >> $@.tmp;                 \</span><br><span style="color: hsl(120, 100%, 40%);">+                echo "Building $(BLD) Failed";                                 \</span><br><span style="color: hsl(120, 100%, 40%);">+    fi;                                                                    \</span><br><span style="color: hsl(120, 100%, 40%);">+      cat $@.tmp.2;                                                          \</span><br><span style="color: hsl(120, 100%, 40%);">+      echo '<![CDATA[' >> $@.tmp;                                            \</span><br><span style="color: hsl(120, 100%, 40%);">+     cat $@.tmp.2 >> $@.tmp;                                                \</span><br><span style="color: hsl(120, 100%, 40%);">+        echo "]]></$$type>" >>$@.tmp;                                          \</span><br><span style="color: hsl(120, 100%, 40%);">+     rm -f $@.tmp.2;                                                        \</span><br><span style="color: hsl(120, 100%, 40%);">+      echo "</testcase>" >> $@.tmp;                                          \</span><br><span style="color: hsl(120, 100%, 40%);">+        echo "</testsuite>" >> $@.tmp;                                         \</span><br><span style="color: hsl(120, 100%, 40%);">+        mv $@.tmp "$$xmlfile"</span><br><span>      echo</span><br><span> </span><br><span> TOOLLIST= \</span><br><span>@@ -77,10 +87,10 @@</span><br><span>        util/abuild/abuild -B -J $(if $(JENKINS_NOCCACHE),,-y) -c $(CPUS) -z -p $(JENKINS_PAYLOAD) -x -X $(top)/abuild-chromeos.xml</span><br><span>  util/abuild/abuild -B -J $(if $(JENKINS_NOCCACHE),,-y) -c $(CPUS) -z -p $(JENKINS_PAYLOAD)</span><br><span>   (cd payloads/libpayload; unset COREBOOT_BUILD_DIR; $(MAKE) $(if $(JENKINS_NOCCACHE),,CONFIG_LP_CCACHE=y) V=$(V) Q=$(Q) junit.xml)</span><br><span style="color: hsl(0, 100%, 40%);">-       $(foreach tool, $(TOOLLIST), $(MAKE) CPUS=$(CPUS) V=$(V) Q=$(Q) BLD_DIR=util/ BLD="$(tool)" MFLAGS= MAKEFLAGS= MAKETARGET= junit.xml; )</span><br><span style="color: hsl(0, 100%, 40%);">-       unset COREBOOT_BUILD_DIR;$(MAKE) CPUS=$(CPUS) V=$(V) Q=$(Q) BLD_DIR=payloads/ BLD=nvramcui MFLAGS= MAKEFLAGS= MAKETARGET=all junit.xml</span><br><span style="color: hsl(0, 100%, 40%);">-  unset COREBOOT_BUILD_DIR;$(MAKE) CPUS=$(CPUS) V=$(V) Q=$(Q) BLD_DIR=payloads/ BLD=coreinfo MFLAGS= MAKEFLAGS= MAKETARGET=defaultbuild junit.xml</span><br><span style="color: hsl(0, 100%, 40%);">- $(MAKE) CPUS=$(CPUS) V=$(V) Q=$(Q) BLD_DIR=util/ BLD=romcc MFLAGS= MAKEFLAGS= MAKETARGET=test junit.xml</span><br><span style="color: hsl(120, 100%, 40%);">+       $(foreach tool, $(TOOLLIST), $(MAKE) CPUS=$(CPUS) V=$(V) Q=$(Q) BLD_DIR="util/$(tool)" BLD="$(tool)" MFLAGS= MAKEFLAGS= MAKETARGET= junit.xml; )</span><br><span style="color: hsl(120, 100%, 40%);">+  unset COREBOOT_BUILD_DIR;$(MAKE) CPUS=$(CPUS) V=$(V) Q=$(Q) BLD_DIR=payloads/nvramcui BLD=nvramcui MFLAGS= MAKEFLAGS= MAKETARGET=all junit.xml</span><br><span style="color: hsl(120, 100%, 40%);">+        unset COREBOOT_BUILD_DIR;$(MAKE) CPUS=$(CPUS) V=$(V) Q=$(Q) BLD_DIR=payloads/coreinfo BLD=coreinfo MFLAGS= MAKEFLAGS= MAKETARGET=defaultbuild junit.xml</span><br><span style="color: hsl(120, 100%, 40%);">+       $(MAKE) CPUS=$(CPUS) V=$(V) Q=$(Q) BLD_DIR=util/romcc BLD=romcc MFLAGS= MAKEFLAGS= MAKETARGET=test junit.xml</span><br><span>         $(MAKE) -C src/soc/nvidia/tegra124/lp0 all clean</span><br><span>     $(MAKE) -C src/soc/nvidia/tegra210/lp0 all clean</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://review.coreboot.org/26421">change 26421</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/26421"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: If6e27e02e25e20f48e5a9372373de6058ca378dd </div>
<div style="display:none"> Gerrit-Change-Number: 26421 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Martin Roth <martinroth@google.com> </div>