fixed lots of warnings in testprograms
[libfirm] / ir / be / test / makediffhtml.xslt
1 <?xml version="1.0"?>
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
3         <xsl:output method="html" indent="yes"
4               doctype-public="-//W3C//DTD HTML 4.01//EN"
5                     doctype-system="http://www.w3.org/TR/html4/strict.dtd"/>
6
7         <xsl:template name="resultcell" match="result/*/*">
8                 <xsl:element name="div">
9                         <xsl:if test="contains(text(), 'ok')">
10                                 <xsl:attribute name="style">background-color: green; color: white;</xsl:attribute>
11                         </xsl:if>
12                         <xsl:if test="contains(text(), 'failed')">
13                                 <xsl:attribute name="style">background-color: red; color: white;</xsl:attribute>
14                         </xsl:if>
15
16                         <xsl:choose>
17                                 <xsl:when test="name() = 'gcc_run'">
18                                         <xsl:element name="a">
19                                                 <xsl:choose>
20                                                         <xsl:when test="contains(text(), 'ok') or contains(text(), 'failed')">
21                                                                 <xsl:attribute name="style">color: white;</xsl:attribute>
22                                                         </xsl:when>
23                                                         <xsl:otherwise>
24                                                                 <xsl:attribute name="style">color: black;</xsl:attribute>
25                                                         </xsl:otherwise>
26                                                 </xsl:choose>
27                                                 <xsl:choose>
28                                                         <xsl:when test="name(..) = 'OLD'">
29                                                                 <xsl:attribute name="href"><xsl:value-of select="substring(/results/files/OLD, 0, 15)"/>/result_gcc_<xsl:value-of select="../../@name"/>.txt</xsl:attribute>
30                                                         </xsl:when>
31                                                         <xsl:otherwise>
32                                                                 <xsl:attribute name="href"><xsl:value-of select="substring(/results/files/NEW, 0, 15)"/>/result_gcc_<xsl:value-of select="../../@name"/>.txt</xsl:attribute>
33                                                         </xsl:otherwise>
34                                                 </xsl:choose>
35                                                 <xsl:value-of select="text()"/>
36                                         </xsl:element>
37                                 </xsl:when>
38                                 <xsl:when test="name() = 'firm_run'">
39                                         <xsl:element name="a">
40                                                 <xsl:choose>
41                                                         <xsl:when test="contains(text(), 'ok') or contains(text(), 'failed')">
42                                                                 <xsl:attribute name="style">color: white;</xsl:attribute>
43                                                         </xsl:when>
44                                                         <xsl:otherwise>
45                                                                 <xsl:attribute name="style">color: black;</xsl:attribute>
46                                                         </xsl:otherwise>
47                                                 </xsl:choose>
48                                                 <xsl:choose>
49                                                         <xsl:when test="name(..) = 'OLD'">
50                                                                 <xsl:attribute name="href">
51                                                                         <xsl:value-of select="substring(/results/files/OLD, 0, 15)"/>/result_firm_<xsl:value-of select="../../@name"/>.txt</xsl:attribute></xsl:when>
52                                                         <xsl:otherwise>
53                                                                 <xsl:attribute name="href"><xsl:value-of select="substring(/results/files/NEW, 0, 15)"/>/result_firm_<xsl:value-of select="../../@name"/>.txt</xsl:attribute>
54                                                         </xsl:otherwise>
55                                                 </xsl:choose>
56                                                 <xsl:value-of select="text()"/>
57                                         </xsl:element>
58                                 </xsl:when>
59                                 <xsl:when test="name() = 'diff'">
60                                         <xsl:element name="a">
61                                                 <xsl:choose>
62                                                         <xsl:when test="contains(text(), 'ok') or contains(text(), 'failed')">
63                                                                 <xsl:attribute name="style">color: white;</xsl:attribute>
64                                                         </xsl:when>
65                                                         <xsl:otherwise>
66                                                                 <xsl:attribute name="style">color: black;</xsl:attribute>
67                                                         </xsl:otherwise>
68                                                 </xsl:choose>
69                                                 <xsl:choose>
70                                                         <xsl:when test="name(..) = 'OLD'">
71                                                                 <xsl:attribute name="href"><xsl:value-of select="substring(/results/files/OLD, 0, 15)"/>/result_diff_<xsl:value-of select="../../@name"/>.txt</xsl:attribute>
72                                                         </xsl:when>
73                                                         <xsl:otherwise>
74                                                                 <xsl:attribute name="href"><xsl:value-of select="substring(/results/files/NEW, 0, 15)"/>/result_diff_<xsl:value-of select="../../@name"/>.txt</xsl:attribute>
75                                                         </xsl:otherwise>
76                                                 </xsl:choose>
77                                                 <xsl:value-of select="text()"/>
78                                         </xsl:element>
79                                 </xsl:when>
80                                 <xsl:otherwise>
81                                         <xsl:value-of select="text()"/>
82                                 </xsl:otherwise>
83                         </xsl:choose>
84                 </xsl:element>
85         </xsl:template>
86
87         <xsl:template match="/">
88                 <html>
89                         <head>
90                                 <title>Results</title>
91                         </head>
92                         <body>
93                                 OLD: <xsl:value-of select="/results/files/OLD"/><br/>
94                                 NEW: <xsl:value-of select="/results/files/NEW"/><br/><br/>
95                                 <table>
96                                         <tr>
97                                                 <th>Name</th>
98                                                 <th>Compile</th>
99                                                 <th>Link</th>
100                                                 <th>GCC Compile</th>
101                                                 <th>GCC Run</th>
102                                                 <th>Firm Run</th>
103                                                 <th>Results</th>
104                                         </tr>
105                                         <xsl:for-each select="/results/section">
106                                                 <tr>
107                                                     <th colspan="7" style="background-color: yellow; color: black;"><xsl:value-of select="@name"/></th>
108                                                 </tr>
109                                                 <xsl:for-each select="result">
110                                                         <tr>
111                                                                 <th rowspan="2">
112                                                                         <xsl:element name="a">
113                                                                                 <xsl:attribute name="href">buildresult_<xsl:value-of select="@name"/>.txt</xsl:attribute>
114                                                                                 <xsl:value-of select="@name"/>
115                                                                         </xsl:element>
116                                                                 </th>
117                                                                 <td><xsl:apply-templates select="OLD/compile"/></td>
118                                                                 <td><xsl:apply-templates select="OLD/link"/></td>
119                                                                 <td><xsl:apply-templates select="OLD/gcc_compile"/></td>
120                                                                 <td><xsl:apply-templates select="OLD/gcc_run"/></td>
121                                                                 <td><xsl:apply-templates select="OLD/firm_run"/></td>
122                                                                 <td><xsl:apply-templates select="OLD/diff"/></td>
123                                                         </tr>
124                                                         <tr>
125                                                                 <td><xsl:apply-templates select="NEW/compile"/></td>
126                                                                 <td><xsl:apply-templates select="NEW/link"/></td>
127                                                                 <td><xsl:apply-templates select="NEW/gcc_compile"/></td>
128                                                                 <td><xsl:apply-templates select="NEW/gcc_run"/></td>
129                                                                 <td><xsl:apply-templates select="NEW/firm_run"/></td>
130                                                                 <td><xsl:apply-templates select="NEW/diff"/></td>
131                                                         </tr>
132                                                         <tr>
133                                                             <th colspan="7"> </th>
134                                                         </tr>
135                                                 </xsl:for-each>
136                                         </xsl:for-each>
137                                 </table>
138                         </body>
139                 </html>
140         </xsl:template>
141 </xsl:stylesheet>