Created
August 30, 2016 17:19
-
-
Save mread/9b1902734b4910adf2d6029cc5d68a31 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> | |
<xsl:template match="/tests"> | |
<testsuite> | |
<xsl:variable name="populatedStacktraces"> | |
<xsl:value-of select="count(test/testresult[not(stacktrace = '')])"/> | |
</xsl:variable> | |
<xsl:variable name="skippedStacktraces"> | |
<xsl:value-of select="count(test/testresult[starts-with(stacktrace, 'org.junit.AssumptionViolatedException')])"/> | |
</xsl:variable> | |
<xsl:attribute name="name">Buck tests</xsl:attribute> | |
<xsl:attribute name="errors">0</xsl:attribute> | |
<xsl:attribute name="failures"> | |
<xsl:value-of select="$populatedStacktraces - $skippedStacktraces"/> | |
</xsl:attribute> | |
<xsl:attribute name="tests"> | |
<xsl:value-of select="count(test/testresult)"/> | |
</xsl:attribute> | |
<xsl:attribute name="skipped"> | |
<xsl:value-of select="$skippedStacktraces"/> | |
</xsl:attribute> | |
<xsl:attribute name="time"> | |
<xsl:value-of select="sum(test/@time) div 1000"/> | |
</xsl:attribute> | |
<xsl:attribute name="timestamp">2014-01-01T00:00:00</xsl:attribute> | |
<properties/> | |
<xsl:for-each select="test/testresult"> | |
<testcase> | |
<xsl:attribute name="classname"> | |
<xsl:value-of select="../@name"/> | |
</xsl:attribute> | |
<xsl:attribute name="name"> | |
<xsl:value-of select="@name"/> | |
</xsl:attribute> | |
<xsl:attribute name="time"> | |
<xsl:value-of select="@time div 1000"/> | |
</xsl:attribute> | |
<xsl:if test="not(stacktrace = '')"> | |
<xsl:choose> | |
<xsl:when test="starts-with(stacktrace, 'org.junit.AssumptionViolatedException')"> | |
<skipped message="{message}"/> | |
</xsl:when> | |
<xsl:otherwise> | |
<failure> | |
<xsl:attribute name="message"> | |
<xsl:value-of select="message"/> | |
</xsl:attribute> | |
<xsl:value-of select="stacktrace"/> | |
</failure> | |
</xsl:otherwise> | |
</xsl:choose> | |
</xsl:if> | |
</testcase> | |
</xsl:for-each> | |
<system-out/> | |
<system-err/> | |
</testsuite> | |
</xsl:template> | |
</xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment