File: TestResults.xsl

package info (click to toggle)
mpich 5.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 251,828 kB
  • sloc: ansic: 1,323,147; cpp: 82,869; f90: 72,420; javascript: 40,763; perl: 28,296; sh: 19,399; python: 16,191; xml: 14,418; makefile: 9,468; fortran: 8,046; java: 4,635; pascal: 352; asm: 324; ruby: 176; awk: 27; lisp: 19; php: 8; sed: 4
file content (101 lines) | stat: -rw-r--r-- 3,054 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<?xml version='1.0' ?>
<!--
    Copyright (C) by Argonne National Laboratory
        See COPYRIGHT in top-level directory
  -->
<!-- <xsl:stylesheet  xmlns:xsl="http://www.w3.org/TR/WD-xsl"> -->
<xsl:stylesheet  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!-- <xsl:output method="html"/>-->

<xsl:template match="/">
<html>
    <head>
        <title>MPICH Error Report</title>
        <style type="text/css">
            table      { border-collapse:collapse; }
            th, td     { border:2px solid blue; padding:2px; }
            td         { vertical-align:top; }
            th         { background-color:#bbf; color:white; }
            tr.fail td { background-color:#fbb; }
            tr.pass td { background-color:#bfb; }
        </style>
    </head>
    <body>
        <h1>MPICH Error Report</h1>
        <xsl:apply-templates select="MPITESTRESULTS"/>
    </body>
</html>
</xsl:template>

<xsl:template match="MPITESTRESULTS">
    <p>
        <xsl:choose>
            <xsl:when test="count(MPITEST[STATUS ='fail']) = 0">
                No failures
            </xsl:when>
            <xsl:otherwise>
                <span style="color: red"><xsl:value-of select="count(MPITEST[STATUS ='fail'])"/> tests failed</span>
            </xsl:otherwise>
        </xsl:choose>
        out of <xsl:value-of select="count(MPITEST)"/> tests run.
        <xsl:apply-templates select="DATE"/>
        <xsl:apply-templates select="TOTALTIME"/>.
    </p>

    <table>
        <tr>
            <th>Dir</th>
            <th>Name</th>
            <th>np</th>
            <th>Status</th>
            <xsl:choose>
                <xsl:when test="count(MPITEST/RUNTIME) > 0">
                    <th>Time</th>
                </xsl:when>
            </xsl:choose>
            <th>Diff</th>
        </tr>
        <xsl:apply-templates select="MPITEST"/>
    </table>
</xsl:template>

<xsl:template match="DATE">The tests started at <xsl:value-of select="."/></xsl:template>
<xsl:template match="TOTALTIME"> and ran for <xsl:value-of select=". div 60"/> minutes</xsl:template>

<xsl:template match="MPITEST">
    <xsl:variable name="status">
        <xsl:choose>
            <xsl:when test="STATUS = 'pass'">
                <xsl:value-of select="'pass'"/>
            </xsl:when>
            <xsl:otherwise>
                <xsl:value-of select="'fail'"/>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:variable>

    <tr class="{$status}">
    <td><xsl:value-of select="WORKDIR"/></td>
    <td><xsl:value-of select="NAME"/></td>
    <td><xsl:value-of select="NP"/></td>
    <td><xsl:value-of select="STATUS"/></td>
    <xsl:choose>
        <xsl:when test="RUNTIME">
            <td><xsl:value-of select="RUNTIME"/></td>
        </xsl:when>
    </xsl:choose>
    <td><pre><xsl:value-of select="TESTDIFF"/></pre></td>
    </tr>
</xsl:template>

<xsl:template match="TRACEBACK">
    <a>
    <xsl:attribute name="HREF">
    <xsl:value-of select="."/>
    </xsl:attribute>
    Traceback
    </a>
</xsl:template>


</xsl:stylesheet>