Created
October 20, 2013 12:35
-
-
Save TheBurnDoc/7068979 to your computer and use it in GitHub Desktop.
XSL transform to produce a human readable HTML page from Google Test XML output
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
<?xml version="1.0" encoding="ISO-8859-1"?> | |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
<xsl:template match="/"> | |
<html> | |
<head> | |
<title>Google Test Report</title> | |
</head> | |
<body> | |
<table cellpadding="2" cellspacing="0" width="100%" border="1"> | |
<tr bgcolor="#CCCCCC"> | |
<th>Test Suite</th><th>Test Case</th><th>Result</th><th>Message(s)</th><th>Run Time</th> | |
</tr> | |
<xsl:for-each select="testsuites/testsuite/testcase"> | |
<tr> | |
<td><xsl:value-of select="@classname"/></td> | |
<td><xsl:value-of select="@name"/></td> | |
<xsl:choose> | |
<xsl:when test="failure"> | |
<td bgcolor="#FF0000" align="center"><b>FAIL</b></td> | |
<td> | |
<xsl:for-each select="failure"> | |
<xsl:value-of select="@message"/><br/> | |
</xsl:for-each> | |
</td> | |
</xsl:when> | |
<xsl:otherwise> | |
<td bgcolor="#00FF00" align="center"><b>PASS</b></td> | |
<td/> | |
</xsl:otherwise> | |
</xsl:choose> | |
<td><xsl:value-of select="@time"/></td> | |
</tr> | |
</xsl:for-each> | |
</table> | |
</body> | |
</html> | |
</xsl:template> | |
</xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment