]> begriffs open source - cmsis/blob - CMSIS/CoreValidation/Tests/validation.xsl
CoreValidation: Fix Arm Compiler 6 linker warnings.
[cmsis] / CMSIS / CoreValidation / Tests / validation.xsl
1 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
2     <xsl:output method="xml" indent="yes"/>
3     <xsl:template match="/">
4         <testsuites>
5             <xsl:variable name="buildName" select="//report/test/title"/>
6             <xsl:variable name="numberOfTests" select="//report/test/summary/tcnt"/>
7             <xsl:variable name="numberOfExecutes" select="//report/test/summary/exec"/>
8             <xsl:variable name="numberOfPasses" select="//report/test/summary/pass"/>
9             <xsl:variable name="numberOfFailures" select="//report/test/summary/fail"/>
10                         <xsl:variable name="numberOfSkips" select="$numberOfTests - $numberOfExecutes"/>
11                         <xsl:variable name="numberOfErrors" select="0"/>
12             <testsuite name="{$buildName}"
13                        tests="{$numberOfTests}" time="0"
14                        failures="{$numberOfFailures}" errors="{$numberOfErrors}"
15                        skipped="{$numberOfSkips}">
16                 <xsl:for-each select="//report/test/test_cases/tc">
17                     <xsl:variable name="testName" select="func"/>
18                     <xsl:variable name="status" select="res"/>
19                     <testcase name="{$testName}">
20                         <xsl:choose>
21                             <xsl:when test="res='PASSED'"/>
22                                                         <xsl:when test="res='NOT EXECUTED'">
23                                                                 <skipped/>
24                                                         </xsl:when>
25                             <xsl:otherwise>
26                                 <xsl:for-each select="dbgi/detail">
27                                     <xsl:variable name="file" select="module"/>
28                                     <xsl:variable name="line" select="line"/>
29                                     <failure>
30                                         <xsl:value-of select="$file"/>:<xsl:value-of select="$line"/>
31                                     </failure>
32                                 </xsl:for-each>
33                             </xsl:otherwise>
34                         </xsl:choose>
35                     </testcase>
36                 </xsl:for-each>
37             </testsuite>
38         </testsuites>
39     </xsl:template>
40 </xsl:stylesheet>