You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

clover.xsl 1.3KB

12345678910111213141516171819202122232425262728293031
  1. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  2. <xsl:output method="xml" indent="yes"/>
  3. <xsl:decimal-format decimal-separator="." grouping-separator="," />
  4. <xsl:template match="coverage">
  5. <xsl:variable name="total" select="project/metrics/@elements"/>
  6. <xsl:variable name="covered" select="project/metrics/@coveredelements"/>
  7. <xsl:variable name="decimal" select="$covered div $total"/>
  8. <build>
  9. <statusInfo>
  10. <text action="append"> coverage: <xsl:value-of select="round($decimal * 10000) div 100"/>%</text>
  11. </statusInfo>
  12. <statisticValue key="cloverTotalElements">
  13. <xsl:attribute name="value">
  14. <xsl:value-of select="$total"/>
  15. </xsl:attribute>
  16. </statisticValue>
  17. <statisticValue key="cloverCoveredElements" value="">
  18. <xsl:attribute name="value">
  19. <xsl:value-of select="$covered"/>
  20. </xsl:attribute>
  21. </statisticValue>
  22. <statisticValue key="cloverPercentElements" value="">
  23. <xsl:attribute name="value">
  24. <xsl:value-of select="round(100 * $decimal)"/>
  25. </xsl:attribute>
  26. </statisticValue>
  27. </build>
  28. </xsl:template>
  29. </xsl:stylesheet>