2002/ws/desc/test-suite assertions-report.xsl,NONE,1.1

Update of /sources/public/2002/ws/desc/test-suite
In directory hutz:/tmp/cvs-serv25227/test-suite

Added Files:
	assertions-report.xsl 
Log Message:
Generates a report indicating the current coverage of the test suite for the spec assertions

--- NEW FILE: assertions-report.xsl ---
<?xml version="1.0" encoding="UTF-8"?>
<!--
	This stylesheet has not been automatically generated. Do
	edit it!
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	version="1.0">

	<xsl:strip-space elements="*" />
	<xsl:output method="xml" indent="yes" />

	<xsl:template match="/">
		<xsl:variable name='ViolatesAssertions'
			select='/ViolatesAssertions' />
		<html lang='en-us'>
			<head>
				<title>Assertion Coverage Report</title>
				<link rel="stylesheet" type="text/css"
					href="http://www.w3.org/StyleSheets/TR/base.css" />
				<style type='text/css'>
					th, td { border: 1px solid black; padding: 0.5ex }
					.class, .count { text-align: center }
				</style>
			</head>
			<body>
				<h1>Assertion Coverage Report</h1>
				<table>
					<thead>
						<tr>
							<th>Status</th>
							<th>Count</th>
							<th>Assertion</th>
							<th>Class</th>
							<th>Tests</th>
						</tr>
					</thead>
					<tbody>
						<xsl:for-each
							select='document("assertions.xml")/assertions/assertion'>
							<xsl:sort select='@id'/>
							<xsl:variable name='id' select='@id'/>
							<xsl:variable name='violations'
								select='$ViolatesAssertions/ViolateAssertion[@assertion=$id]'/>
							<xsl:variable name='count'
								select='count($violations)'/>
							<tr>
								<td>
                                <xsl:attribute name="bgcolor">
                                        <xsl:choose>
                                                <xsl:when test="$count = 0">red</xsl:when>
                                                <xsl:when test="$count &lt; 4">yellow</xsl:when>
                                                <xsl:otherwise>green</xsl:otherwise>
                                        </xsl:choose>
                                </xsl:attribute>
                                <xsl:text>&#160;</xsl:text>
								</td>
								<td class='count'><xsl:value-of select='$count'/></td>
								<td>
									<a href='{concat(@origin, "/#", @id)}'><xsl:value-of select='$id' />
									&#160;<img src='information-icon.gif' alt='{.}'/></a>
								</td>
								<td class='class'><xsl:value-of select='@class' /></td>
								<td>
									<xsl:for-each select='$violations'>
										<xsl:text>[</xsl:text><a href='{@origin}'><xsl:value-of select='@test-id'/></a><xsl:text>] </xsl:text>
									</xsl:for-each>
								</td>
							</tr>
						</xsl:for-each>
					</tbody>
				</table>
			</body>
		</html>
	</xsl:template>

	<xsl:template match='assertion'></xsl:template>
</xsl:stylesheet>

Received on Wednesday, 5 July 2006 22:26:20 UTC