Last active
September 12, 2017 13:58
-
-
Save Trass3r/e8b5bdf3c3a59697c49bf8ab0dd2e183 to your computer and use it in GitHub Desktop.
OpenCppCoverage for TeamCity
This file contains hidden or 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="utf-8"?> | |
| <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"> | |
| <xsl:output method="text" encoding="utf-8"/> | |
| <xsl:variable name='nl'> | |
| <xsl:text>
</xsl:text> | |
| </xsl:variable> | |
| <xsl:template match="/"> | |
| <xsl:variable name="total_lines" select="count(/coverage/packages/package/classes/class/lines/line)" /> | |
| <xsl:variable name="covered_lines" select="count(/coverage/packages/package/classes/class/lines/line[@hits!='0'])" /> | |
| <xsl:text>##teamcity[buildStatisticValue key='CodeCoverageAbsLTotal' value='</xsl:text> | |
| <xsl:value-of select="$total_lines"/> | |
| <xsl:text>']</xsl:text> | |
| <xsl:value-of select="$nl"/> | |
| <xsl:text>##teamcity[buildStatisticValue key='CodeCoverageAbsLCovered' value='</xsl:text> | |
| <xsl:value-of select="$covered_lines"/> | |
| <xsl:text>']</xsl:text> | |
| <xsl:value-of select="$nl"/> | |
| </xsl:template> | |
| </xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment