CUnit-Run.xsl 4.31 KB
Newer Older
1 2 3 4
<?xml version='1.0'?>
<xsl:stylesheet
	version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
5

6 7
	<xsl:template match="CUNIT_TEST_RUN_REPORT">
		<html>
8 9 10 11 12 13 14 15
			<head>
				<title> CUnit - Automated Test Run Summary Report </title>
			</head>

			<body bgcolor="#e0e0f0">
				<xsl:apply-templates/>
			</body>
		</html>
16
	</xsl:template>
17

18 19
	<xsl:template match="CUNIT_HEADER">
		<div align="center">
20 21 22 23 24
			<h3>
				<b> CUnit - A Unit testing framework for C. </b> <br/>
				<a href="http://cunit.sourceforge.net/"> http://cunit.sourceforge.net/ </a>
			</h3>
		</div>
25
	</xsl:template>
26

27
	<xsl:template match="CUNIT_RESULT_LISTING">
28 29 30 31
		<p/>
		<div align="center">
			<h2> Automated Test Run Results </h2>
		</div>
32
		<table cols="4" width="90%" align="center">
33
			<tr>
34 35 36 37
				<td width="25%"> </td>
				<td width="25%"> </td>
				<td width="25%"> </td>
				<td width="25%"> </td>
38
			</tr>
39
			<xsl:apply-templates/>
40
		</table>
41
	</xsl:template>
42

43 44 45
	<xsl:template match="CUNIT_RUN_SUITE">
		<xsl:apply-templates/>
	</xsl:template>
46

47 48
	<xsl:template match="SUITE_NAME">
	</xsl:template>
49

50
	<xsl:template match="CUNIT_RUN_SUITE_SUCCESS">
51
		<tr bgcolor="#f0e0f0">
52 53 54
			<td colspan="4">
				Running Suite <xsl:value-of select="SUITE_NAME"/>
			</td>
55
		</tr>
56
		<xsl:apply-templates/>
57
	</xsl:template>
58

59 60 61
	<xsl:template match="CUNIT_RUN_GROUP">
		<xsl:apply-templates/>
	</xsl:template>
62

63
	<xsl:template match="CUNIT_RUN_GROUP_SUCCESS">
64
		<tr bgcolor="#f0e0f0">
65 66 67
			<td colspan="4">
				Running Group <xsl:apply-templates/>
			</td>
68 69
		</tr>
	</xsl:template>
70

71 72 73
	<xsl:template match="CUNIT_RUN_TEST_RECORD">
		<xsl:apply-templates/>
	</xsl:template>
74

75
	<xsl:template match="CUNIT_RUN_TEST_SUCCESS">
76
		<tr bgcolor="#e0f0d0">
77 78 79 80 81 82
			<td> </td>
			<td colspan="2">
				Running test <xsl:apply-templates/>...
			</td>
			<td bgcolor="#50ff50"> Passed </td>
		</tr>
83
	</xsl:template>
84

85
	<xsl:template match="CUNIT_RUN_TEST_FAILURE">
86
		<tr bgcolor="#e0f0d0">
87 88 89 90 91
			<td> </td>
			<td colspan="2">
				Running test <xsl:value-of select="TEST_NAME"/>...
			</td>
			<td bgcolor="#ff5050"> Failed </td>
92
		</tr>
93

94
		<tr>
95
			<td colspan="4" bgcolor="#ff9090">
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112
				<table width="100%">
					<tr>
						<th width="15%"> File Name </th>
						<td width="50%" bgcolor="#e0eee0">
							<xsl:value-of select="FILE_NAME"/>
						</td>
						<th width="20%"> Line Number </th>
						<td width="10%" bgcolor="#e0eee0">
							<xsl:value-of select="LINE_NUMBER"/>
						</td>
					</tr>
					<tr>
						<th width="15%"> Condition </th>
						<td colspan="3" width="85%" bgcolor="#e0eee0">
							<xsl:value-of select="CONDITION"/>
						</td>
					</tr>
113
				</table>
114
			</td>
115 116
		</tr>
	</xsl:template>
117

118 119
	<xsl:template match="CUNIT_RUN_SUITE_FAILURE">
		<tr>
120 121 122 123 124 125 126
			<td colspan="3" bgcolor="#f0b0f0">
				Running Suite <xsl:value-of select="SUITE_NAME"/>...
			</td>
			<td bgcolor="#ff7070">
				<xsl:value-of select="FAILURE_REASON"/>
			</td>
		</tr>
127
	</xsl:template>
128

129 130
	<xsl:template match="CUNIT_RUN_GROUP_FAILURE">
		<tr>
131 132 133 134 135 136 137
			<td colspan="3" bgcolor="#f0b0f0">
				Running Group <xsl:value-of select="GROUP_NAME"/>...
			</td>
			<td bgcolor="#ff7070">
				<xsl:value-of select="FAILURE_REASON"/>
			</td>
		</tr>
138
	</xsl:template>
139

140 141 142
	<xsl:template match="CUNIT_RUN_SUMMARY">
		<p/>
		<table width="90%" rows="5" align="center">
143 144 145 146 147 148 149 150 151 152
			<tr align="center" bgcolor="skyblue">
				<th colspan="6"> Cumulative Summary for Run </th>
			</tr>
			<tr>
				<th width="15%" bgcolor="#ffffc0" align="center"> Type </th>
				<th width="17%" bgcolor="#ffffc0" align="center"> Total </th>
				<th width="17%" bgcolor="#ffffc0" align="center"> Run </th>
				<th width="17%" bgcolor="#ffffc0" align="center"> Succeeded </th>
				<th width="17%" bgcolor="#ffffc0" align="center"> Failed </th>
				<th width="17%" bgcolor="#ffffc0" align="center"> Inactive </th>
153
			</tr>
154 155 156 157 158 159 160 161 162 163
			<xsl:for-each select="CUNIT_RUN_SUMMARY_RECORD">
				<tr align="center" bgcolor="lightgreen">
					<td> <xsl:value-of select="TYPE" /> </td>
					<td> <xsl:value-of select="TOTAL" /> </td>
					<td> <xsl:value-of select="RUN" /> </td>
					<td> <xsl:value-of select="SUCCEEDED" /> </td>
					<td> <xsl:value-of select="FAILED" /> </td>
					<td> <xsl:value-of select="INACTIVE" /> </td>
				</tr>
			</xsl:for-each>
164 165
		</table>
	</xsl:template>
166

167 168
	<xsl:template match="CUNIT_FOOTER">
		<p/>
169 170
		<hr align="center" width="90%" color="maroon" />
		<h5 align="center"> <xsl:apply-templates/> </h5>
171
	</xsl:template>
172

173
</xsl:stylesheet>