Thursday, October 30, 2014

Quick parsing boost test xml output for quick failed passed table

Pretty print Boost Test XML output.
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="txt" indent="no"/>
<xsl:template match="TestCase">
<xsl:variable name="test_result">
<xsl:choose>
<xsl:when test="Error">Failed</xsl:when>
<xsl:otherwise>Passed</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:value-of select="$test_result" /><xsl:text>&#9;</xsl:text> <xsl:value-of select="@name" /><xsl:text>&#xa;</xsl:text>
</xsl:template>
<xsl:template match="TestSuite">
<xsl:apply-templates select="TestCase" />
</xsl:template>
</xsl:stylesheet>
~
view raw gistfile1.xml hosted with ❤ by GitHub

No comments:

Post a Comment