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.2KB

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. <statisticValue key="cloverTotalElements">
  10. <xsl:attribute name="value">
  11. <xsl:value-of select="$total"/>
  12. </xsl:attribute>
  13. </statisticValue>
  14. <statisticValue key="cloverCoveredElements" value="">
  15. <xsl:attribute name="value">
  16. <xsl:value-of select="$covered"/>
  17. </xsl:attribute>
  18. </statisticValue>
  19. <statisticValue key="cloverPercentElements" value="">
  20. <xsl:attribute name="value">
  21. <xsl:value-of select="$decimal"/>
  22. </xsl:attribute>
  23. </statisticValue>
  24. <statusInfo>
  25. <text action="append"> coverage: <xsl:value-of select="round($decimal * 10000) div 100"/>%</text>
  26. </statusInfo>
  27. </build>
  28. </xsl:template>
  29. </xsl:stylesheet>