[xharness] Improve translation from xml to log file. Partially fixes #51661. (#2147)

This makes the failed tests show up in the html report itself, and it will
also show the failure message and stack trace in the produced log.

https://bugzilla.xamarin.com/show_bug.cgi?id=51661
This commit is contained in:
Rolf Bjarne Kvinge 2017-05-31 17:34:03 +02:00 коммит произвёл GitHub
Родитель b4331523f6
Коммит 8b0c75c590
1 изменённых файлов: 21 добавлений и 14 удалений

Просмотреть файл

@ -13,22 +13,27 @@
<xsl:text>&#10;</xsl:text>
<xsl:for-each select="current()/results/test-case">
<xsl:choose>
<xsl:when test="@result">
<xsl:if test="@result='Success'">
<xsl:when test="@result='Success'">
<xsl:text> [PASS] </xsl:text>
</xsl:if>
<xsl:if test="@result='Failure'">
<xsl:text> [FAIL] </xsl:text>
</xsl:if>
<xsl:if test="@result='Ignored'">
<xsl:text> [IGNORED] </xsl:text>
</xsl:if>
<xsl:if test="@result='Inconclusive'">
<xsl:text> [INCONCLUSIVE] </xsl:text>
</xsl:if>
</xsl:when>
<xsl:when test="@result='Failure' or @result='Error'">
<xsl:text> [FAIL] </xsl:text>
</xsl:when>
<xsl:when test="@result='Ignored'">
<xsl:text> [IGNORED] </xsl:text>
</xsl:when>
<xsl:when test="@result='Inconclusive'">
<xsl:text> [INCONCLUSIVE] </xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text> [INFO] </xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="../../@name"/><xsl:text>.</xsl:text><xsl:value-of select="@name"/><xsl:text>&#10;</xsl:text>
<xsl:value-of select="../../@name"/><xsl:text>.</xsl:text><xsl:value-of select="@name"/><xsl:if test="failure/message != ''"> : </xsl:if><xsl:value-of select="failure/message"/><xsl:text>&#10;</xsl:text>
<xsl:if test="failure/stack-trace != ''">
<xsl:value-of select="failure/stack-trace"/>
<xsl:text>&#10;</xsl:text>
</xsl:if>
</xsl:for-each>
<xsl:choose>
<xsl:when test="@time">
@ -40,6 +45,8 @@
</xsl:choose>
<xsl:text>&#10;</xsl:text>
</xsl:template>
<xsl:template match="//test-suite[@type!='TestFixture']/failure/message">
</xsl:template>
</xsl:stylesheet>