a | b | |
---|
| 0 | + | <?xml version="1.0" encoding="UTF-8"?> |
---|
| 0 | + | <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> |
---|
| 0 | + | <xsl:output method="xml" indent="yes" /> |
---|
| 0 | + | |
---|
| 0 | + | <xsl:param name="suitename" /> |
---|
| 0 | + | |
---|
| 0 | + | <xsl:variable name="cunitCount" select="count(//CUNIT_RUN_TEST_RECORD)"/> |
---|
| 0 | + | <xsl:variable name="cunitFailureCount" select="count(//CUNIT_RUN_TEST_FAILURE)"/> |
---|
| 0 | + | |
---|
| 0 | + | <xsl:template match="/"> |
---|
| 0 | + | <testsuites> |
---|
| 0 | + | <xsl:attribute name="errors">0</xsl:attribute> |
---|
| 0 | + | <xsl:attribute name="failures"> |
---|
| 0 | + | <xsl:value-of select="$cunitFailureCount"/> |
---|
| 0 | + | </xsl:attribute> |
---|
| 0 | + | <xsl:attribute name="tests"> |
---|
| 0 | + | <xsl:value-of select="$cunitCount"/> |
---|
| 0 | + | </xsl:attribute> |
---|
| 0 | + | <xsl:attribute name="name"> |
---|
| 0 | + | <xsl:value-of select="$suitename" /> |
---|
| 0 | + | </xsl:attribute> |
---|
| 0 | + | <xsl:apply-templates /> |
---|
| 0 | + | </testsuites> |
---|
| 0 | + | </xsl:template> |
---|
| 0 | + | |
---|
| 0 | + | <xsl:template match="/CUNIT_TEST_RUN_REPORT/CUNIT_RESULT_LISTING"> |
---|
| 0 | + | <xsl:for-each select="CUNIT_RUN_SUITE/CUNIT_RUN_SUITE_SUCCESS"> |
---|
| 0 | + | <xsl:variable name="localCunitFailureCount" select="count(CUNIT_RUN_TEST_RECORD/CUNIT_RUN_TEST_FAILURE)"/> |
---|
| 0 | + | <xsl:variable name="localCunitCount" select="count(CUNIT_RUN_TEST_RECORD)"/> |
---|
| 0 | + | <xsl:variable name="sn" select="normalize-space(SUITE_NAME/text())"/> |
---|
| 0 | + | <testsuite> |
---|
| 0 | + | <xsl:attribute name="errors">0</xsl:attribute> |
---|
| 0 | + | <xsl:attribute name="failures"> |
---|
| 0 | + | <xsl:value-of select="$localCunitFailureCount"/> |
---|
| 0 | + | </xsl:attribute> |
---|
| 0 | + | <xsl:attribute name="tests"> |
---|
| 0 | + | <xsl:value-of select="$localCunitCount"/> |
---|
| 0 | + | </xsl:attribute> |
---|
| 0 | + | <xsl:attribute name="name"> |
---|
| 0 | + | <xsl:value-of select="$sn"/> |
---|
| 0 | + | </xsl:attribute> |
---|
| 0 | + | <xsl:apply-templates select="CUNIT_RUN_TEST_RECORD" /> |
---|
| 0 | + | </testsuite> |
---|
| 0 | + | </xsl:for-each> |
---|
| 0 | + | </xsl:template> |
---|
| 0 | + | |
---|
| 0 | + | <xsl:template match="CUNIT_RUN_TEST_RECORD"> |
---|
| 0 | + | <xsl:apply-templates select="CUNIT_RUN_TEST_SUCCESS" /> |
---|
| 0 | + | <xsl:apply-templates select="CUNIT_RUN_TEST_FAILURE" /> |
---|
| 0 | + | </xsl:template> |
---|
| 0 | + | |
---|
| 0 | + | <xsl:template match="CUNIT_RUN_TEST_SUCCESS"> |
---|
| 0 | + | <testcase> |
---|
| 0 | + | <xsl:attribute name="classname"> |
---|
| 0 | + | <xsl:value-of select="substring-before(substring-after(TEST_NAME,'test_'),'_')" /> |
---|
| 0 | + | </xsl:attribute> |
---|
| 0 | + | <xsl:attribute name="name"> |
---|
| 0 | + | <xsl:value-of select="normalize-space(TEST_NAME)" /> |
---|
| 0 | + | </xsl:attribute> |
---|
| 0 | + | <xsl:attribute name="time">0</xsl:attribute> |
---|
| 0 | + | </testcase> |
---|
| 0 | + | </xsl:template> |
---|
| 0 | + | <xsl:template match="CUNIT_RUN_TEST_FAILURE"> |
---|
| 0 | + | <testcase> |
---|
| 0 | + | <xsl:attribute name="classname"> |
---|
| 0 | + | <xsl:value-of select="substring-before(substring-after(TEST_NAME,'test_'),'_')" /> |
---|
| 0 | + | </xsl:attribute> |
---|
| 0 | + | <xsl:attribute name="name"> |
---|
| 0 | + | <xsl:value-of select="normalize-space(TEST_NAME)" /> |
---|
| 0 | + | </xsl:attribute> |
---|
| 0 | + | <xsl:attribute name="time">0</xsl:attribute> |
---|
| 0 | + | <failure> |
---|
| 0 | + | <xsl:attribute name="message"> |
---|
| 0 | + | <xsl:value-of select=" normalize-space(CONDITION)" /> |
---|
| 0 | + | </xsl:attribute> |
---|
| 0 | + | <xsl:attribute name="type">Failure</xsl:attribute> |
---|
| 0 | + | <xsl:value-of select="normalize-space(CONDITION)" /> |
---|
| 0 | + | File: <xsl:value-of select="normalize-space(FILE_NAME)" /> |
---|
| 0 | + | Line: <xsl:value-of select="normalize-space(LINE_NUMBER)" /> |
---|
| 0 | + | </failure> |
---|
| 0 | + | </testcase> |
---|
| 0 | + | </xsl:template> |
---|
| 0 | + | |
---|
| 0 | + | <xsl:template match="text()|@*" /> |
---|
| 0 | + | |
---|
| 0 | + | </xsl:stylesheet> |
---|
... | |
---|