-
Notifications
You must be signed in to change notification settings - Fork 15
/
nosetests.xslt
142 lines (124 loc) · 5.39 KB
/
nosetests.xslt
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:template match="/">
<xsl:text disable-output-escaping="yes"><![CDATA[<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">]]></xsl:text>
<html>
<head>
<title>
Xunit Test Results - For: <xsl:value-of select="@name"/>
</title>
<style type="text/css">
.testcases {
border: 1px solid black;
padding: 10px;
}
.filters {
margin: 10px 0 0 0;
}
.failed {
display:block;
}
.failed a {
color: red;
font-weight: bold;
}
.passed {
display: block;
}
.passed a {
color: green;
font-weight: bold;
}
.passed-message {
border: 1px solid green;
}
.error-message {
border: 1px solid red;
}
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"/>
<script type="text/javascript">
$(document).ready(function() {
$(".display-message").click(function() {
});
$(".filter").change(function(event) {
var self = $(this);
$('.filter option:selected').each(function() {
$('.testcases div').show();
if ( $(this).val() != 'all' ) {
$('.testcases div[class != "' + $(this).val() + '"][class!="error-message"]').each(function() {
$(this).hide();
});
}
});
});
});
</script>
</head>
<body>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<xsl:template match="assemblies">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="testsuite">
<h3 class="divided">
<b>Results for <xsl:value-of select="@name"/></b>
</h3>
<div class="container">
Tests run: <a href="#all"><b><xsl:value-of select="@tests"/></b></a>
Failures: <a href="#failures"><b><xsl:value-of select="@failures"/></b></a>,
Skipped: <a href="#skipped"><b><xsl:value-of select="@skip"/></b></a>,
Errors: <a href="#errors"><b><xsl:value-of select="@errors"/></b></a>
<div class="filters">
<label for="filter">Filter Test cases:</label>
<select id="filter" class="filter">
<option name="all" value="all" selected="true">All</option>
<option name="passed" value="passed">Passed</option>
<option name="failed" value="failed">Failed</option>
</select>
</div>
<hr></hr>
</div>
<div class="testcases">
<xsl:for-each select="testcase">
<xsl:choose>
<xsl:when test="not(*)">
<div class="passed">
<pre><b>Class:</b> <xsl:value-of select="@classname"/></pre>
<pre><b>Test Name:</b> <xsl:value-of select="@name"/></pre>
<pre><b>Running Time:</b> <xsl:value-of select="@time"/></pre>
<pre><b>State:</b><a>Passed</a></pre>
<xsl:for-each select="*">
<xsl:if test="@message">
<div class="passed-message">
<xsl:value-of select="@message"/>
</div>
</xsl:if>
</xsl:for-each>
<hr></hr>
</div>
</xsl:when>
<xsl:otherwise>
<div class="failed">
<pre><b>Class:</b> <xsl:value-of select="@classname"/></pre>
<pre><b>Test Name:</b> <xsl:value-of select="@name"/></pre>
<pre><b>Running Time:</b> <xsl:value-of select="@time"/></pre>
<pre><b>State:</b><a>Failed</a></pre>
<xsl:for-each select="failure">
<div class="error-message">
<pre><a class="display-message"> Error Message</a></pre>
<xsl:value-of select="."/>
</div>
</xsl:for-each>
<hr></hr>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</div>
</xsl:template>
</xsl:stylesheet>