Skip to content

Instantly share code, notes, and snippets.

@milgner
Created February 22, 2013 17:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save milgner/5015106 to your computer and use it in GitHub Desktop.
Save milgner/5015106 to your computer and use it in GitHub Desktop.
XSL to transform a validation result XML from the Windows Application Certification Kit into a JUnit XML which can be parsed by common Continuous Integration systems such as Jenkins. Copyright (C)2013 doo GmbH, licensed under MIT License. See https://github.com/doo/metro-driver for a tool which can install appx packages for automatic processing …
<?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="xml" encoding="utf-8" indent="yes"/>
<xsl:template match="REPORT">
<testsuites>
<xsl:apply-templates select="REQUIREMENTS/REQUIREMENT"/>
</testsuites>
</xsl:template>
<xsl:template match="REQUIREMENT">
<testsuite>
<xsl:attribute name="name">
<xsl:value-of select="@TITLE"/>
</xsl:attribute>
<xsl:apply-templates select="TEST">
<xsl:with-param name="Requirement" select="."/>
</xsl:apply-templates>
</testsuite>
</xsl:template>
<xsl:template match="TEST">
<xsl:param name="Requirement"/>
<testcase>
<xsl:attribute name="classname">
<xsl:value-of select="$Requirement/@TITLE"/>
</xsl:attribute>
<xsl:attribute name="name">
<xsl:value-of select="@NAME"/>
</xsl:attribute>
<xsl:choose>
<!-- skip this test because the package is installed in authoring mode and it fails -->
<xsl:when test="RESULT='FAIL' and @NAME != 'Bytecode generation'">
<failure>
<xsl:value-of select="MESSAGES/MESSAGE/@TEXT"/>
</failure>
</xsl:when>
</xsl:choose>
</testcase>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment