gen-suites-report.xsl revision 4723
3032N/A<?
xml version="1.0" encoding="ISO-8859-1"?>
3032N/A<
xsl:
stylesheet version="1.0" 3112N/A ! The contents of this file are subject to the terms of the 3112N/A ! Common Development and Distribution License, Version 1.0 only 3112N/A ! (the "License"). You may not use this file except in compliance 3112N/A ! You can obtain a copy of the license at 3112N/A ! See the License for the specific language governing permissions 3112N/A ! and limitations under the License. 3112N/A ! When distributing Covered Code, include this CDDL HEADER in each 3112N/A ! file and include the License file at 3112N/A ! add the following below this CDDL HEADER, with the fields enclosed 3112N/A ! by brackets "[]" replaced with your own identifying information: 3112N/A ! Portions Copyright [yyyy] [name of copyright owner] 4458N/A ! Copyright 2008-2009 Sun Microsystems, Inc. 3032N/A<
xsl:
output method="html" version="4.0" encoding="iso-8859-1" indent="yes"/>
3032N/A<
xsl:
param name="group">''</
xsl:
param>
3032N/A<
xsl:
variable name="groupdir" select="translate($group, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
4259N/A <
xsl:
apply-
templates select="qa"/>
4259N/A <
xsl:
apply-
templates select="stress-tests"/>
4259N/A <
xsl:
apply-
templates select="functional-tests"/>
4259N/A<
xsl:
template match="stress-tests">
4259N/A <
xsl:
call-
template name="main">
4259N/A <
xsl:
with-
param name="tests-type" select="normalize-space('Stress Tests')"/>
4259N/A<
xsl:
template match="functional-tests">
4259N/A <
xsl:
call-
template name="main">
4259N/A <
xsl:
with-
param name="tests-type" select="normalize-space('Functional Tests')"/>
4259N/A <
xsl:
param name="tests-type"/>
3862N/A <!--- Test Suites Report Header Variables --> 4259N/A <
xsl:
variable name="id" select="identification"/>
4723N/A <
xsl:
variable name="productname" select="normalize-space($sut/name)"/>
4259N/A <
xsl:
variable name="testgroup" select="results/testgroup[translate(@name, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz') = $groupdir]"/>
3032N/A <
xsl:
variable name="total-tests" select="count($testcase)"/>
3032N/A <
xsl:
variable name="pass-tests" select="count($testcase[@result='pass'])"/>
3032N/A <
xsl:
variable name="fail-tests" select="count($testcase[@result='fail'])"/>
3032N/A <
xsl:
variable name="inconc-tests" select="count($testcase[@result='unknown'])"/>
4716N/A <
xsl:
value-
of select="concat('Test Suites Report for ',$productname,' ',$version)"/>
4259N/A <
table class="tertmasttable" width="100%" cellspacing="0">
4259N/A <
td align="center"><
div class="collectionheader"><
xsl:
value-
of select="$tests-type"/></
div></
td>
3032N/A <
table class="tertmasttable" width="100%" cellspacing="0">
4716N/A <
td><
div class="collectionheader"><
xsl:
value-
of select="concat('Test Suites Report for ',$productname,' ',$version)"/></
div></
td>
3032N/A <!-- Overall Test Percentage --> 3032N/A <
xsl:
variable name="percent-tests">
3032N/A <
xsl:
when test="$total-tests > 0">
3032N/A <
xsl:
value-
of select="round((($pass-tests div $total-tests) * 100) - 0.5)"/>
3032N/A <
xsl:
attribute name="noshade">
3032N/A <
xsl:
value-
of select="'noshade'"/>
3032N/A <
xsl:
attribute name="size">
3032N/A <
xsl:
attribute name="width">
3032N/A <
xsl:
value-
of select="'100%'"/>
3032N/A <
xsl:
call-
template name="setColour">
3032N/A <
xsl:
with-
param name="percent" select="$percent-tests"/>
3270N/A <
xsl:
with-
param name="red" select="'70'"/>
3270N/A <
xsl:
with-
param name="yellow" select="'95'"/>
3032N/A <
xsl:
attribute name="align">
3032N/A <
xsl:
value-
of select="'center'"/>
3032N/A <
xsl:
attribute name="size">
3032N/A <
xsl:
value-
of select="'+2'"/>
3032N/A <
xsl:
value-
of select="concat($percent-tests,'%')"/>
3032N/A <
xsl:
attribute name="noshade">
3032N/A <
xsl:
value-
of select="'noshade'"/>
3032N/A <
xsl:
attribute name="size">
3032N/A <
xsl:
attribute name="width">
3032N/A <
xsl:
value-
of select="'100%'"/>
3032N/A <
xsl:
attribute name="align">
3032N/A <
xsl:
value-
of select="'center'"/>
3032N/A <
xsl:
value-
of select="'Build'"/>
3032N/A <
xsl:
attribute name="align">
3032N/A <
xsl:
value-
of select="'center'"/>
3032N/A <
xsl:
value-
of select="'Revision'"/>
3032N/A <
xsl:
attribute name="align">
3032N/A <
xsl:
value-
of select="'center'"/>
3032N/A <
xsl:
value-
of select="'Host'"/>
3032N/A <
xsl:
attribute name="align">
3032N/A <
xsl:
value-
of select="'center'"/>
3032N/A <
xsl:
value-
of select="'Platform'"/>
3032N/A <
xsl:
attribute name="align">
3032N/A <
xsl:
value-
of select="'center'"/>
3032N/A <
xsl:
value-
of select="'JVM'"/>
3032N/A <
xsl:
attribute name="align">
3032N/A <
xsl:
value-
of select="'center'"/>
3032N/A <
xsl:
value-
of select="'Total'"/>
3032N/A <
xsl:
attribute name="align">
3032N/A <
xsl:
value-
of select="'center'"/>
3032N/A <
xsl:
value-
of select="'Pass'"/>
3032N/A <
xsl:
attribute name="align">
3032N/A <
xsl:
value-
of select="'center'"/>
3032N/A <
xsl:
value-
of select="'Fail'"/>
3032N/A <
xsl:
attribute name="align">
3032N/A <
xsl:
value-
of select="'center'"/>
3292N/A <
xsl:
value-
of select="'Inconc'"/>
3292N/A <
xsl:
attribute name="align">
3292N/A <
xsl:
value-
of select="'center'"/>
3292N/A <
xsl:
value-
of select="'Kfail'"/>
3032N/A <
xsl:
attribute name="align">
3032N/A <
xsl:
value-
of select="'center'"/>
3032N/A <
xsl:
value-
of select="$buildid"/>
3032N/A <
xsl:
attribute name="align">
3032N/A <
xsl:
value-
of select="'center'"/>
3032N/A <
xsl:
value-
of select="$revision"/>
3032N/A <
xsl:
attribute name="align">
3032N/A <
xsl:
value-
of select="'center'"/>
3032N/A <
xsl:
value-
of select="$hostname"/>
3032N/A <
xsl:
attribute name="align">
3032N/A <
xsl:
value-
of select="'center'"/>
3032N/A <
xsl:
value-
of select="$os"/>
3032N/A <
xsl:
attribute name="align">
3032N/A <
xsl:
value-
of select="'center'"/>
3032N/A <
xsl:
value-
of select="$jvm"/>
3032N/A <
xsl:
attribute name="align">
3032N/A <
xsl:
value-
of select="'center'"/>
3032N/A <
xsl:
value-
of select="$total-tests"/>
3032N/A <
xsl:
attribute name="align">
3032N/A <
xsl:
value-
of select="'center'"/>
3032N/A <
xsl:
value-
of select="$pass-tests"/>
3032N/A <
xsl:
attribute name="align">
3032N/A <
xsl:
value-
of select="'center'"/>
3032N/A <
xsl:
value-
of select="$fail-tests"/>
3032N/A <
xsl:
attribute name="align">
3032N/A <
xsl:
value-
of select="'center'"/>
3032N/A <
xsl:
value-
of select="$inconc-tests"/>
3292N/A <
xsl:
attribute name="align">
3292N/A <
xsl:
value-
of select="'center'"/>
3292N/A <
xsl:
value-
of select="$kfail-tests"/>
3032N/A <
xsl:
attribute name="noshade">
3032N/A <
xsl:
value-
of select="'noshade'"/>
3032N/A <
xsl:
attribute name="size">
3032N/A <!-- Test Results Table --> 3032N/A <
xsl:
attribute name="width">
3032N/A <
xsl:
value-
of select="'100%'"/>
3032N/A <
xsl:
attribute name="border">
3032N/A <
xsl:
attribute name="cellpadding">
3032N/A <
xsl:
attribute name="bgcolor">
3032N/A <
xsl:
value-
of select="'lightblue'"/>
3032N/A <
xsl:
value-
of select="'Test Suite'"/>
3032N/A <
xsl:
value-
of select="'Start Time'"/>
3032N/A <
xsl:
value-
of select="'End Time'"/>
3032N/A <
xsl:
value-
of select="'Duration'"/>
3032N/A <
xsl:
value-
of select="'Total'"/>
3032N/A <
xsl:
value-
of select="'Pass'"/>
3032N/A <
xsl:
value-
of select="'Fail'"/>
3032N/A <
xsl:
value-
of select="'Inconc'"/>
3292N/A <
xsl:
value-
of select="'Kfail'"/>
3032N/A <
xsl:
value-
of select="'Percent'"/>
3032N/A <
xsl:
for-
each select="$testsuite">
3032N/A <
xsl:
sort select="suite" order="ascending"/>
3032N/A <
xsl:
variable name="suite" select="@name"/>
3032N/A <
xsl:
if test="generate-id(.)=generate-id($testsuite[@name = $suite])">
3032N/A <
xsl:
variable name="all-tests" select="$testcase[@suite = $suite]"/>
3032N/A <
xsl:
variable name="test-num" select="count($all-tests)"/>
3032N/A <
xsl:
variable name="test-pass" select="count($all-tests[@result = 'pass'])"/>
3032N/A <
xsl:
variable name="test-fail" select="count($all-tests[@result = 'fail'])"/>
3032N/A <
xsl:
variable name="test-inc" select="count($all-tests[@result = 'unknown'])"/>
3951N/A <
xsl:
variable name="test-kfail" select="count($all-tests[@suite=$suite]/issues)"/>
3032N/A <
xsl:
variable name="test-percent" select="round((($test-pass div $test-num) * 100) - 0.5)"/>
3032N/A <
xsl:
variable name="suitename" select="translate(@name, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
3032N/A <
xsl:
variable name="end-time">
3032N/A <
xsl:
for-
each select="$all-tests/@stop">
3032N/A <
xsl:
if test="position() = last()">
3032N/A <
xsl:
variable name="duration">
3032N/A <
xsl:
call-
template name="countDuration">
3032N/A <
xsl:
with-
param name="testList" select="$all-tests"/>
3292N/A <
xsl:
attribute name="bgcolor">
3292N/A <
xsl:
when test="$test-percent = '100'">
3292N/A <
xsl:
value-
of select="'lightgreen'" />
3292N/A <
xsl:
when test="$test-fail = $test-kfail">
3292N/A <
xsl:
value-
of select="'yellow'" />
3292N/A <
xsl:
value-
of select="'red'" />
3032N/A <
xsl:
attribute name="align">
3032N/A <
xsl:
value-
of select="'left'"/>
3032N/A <
xsl:
attribute name="href">
3862N/A <
xsl:
value-
of select="concat($url,$tests-dir,'/testlogs/',$groupdir,'/',@shortname,'-report.html')"/>
3032N/A <
xsl:
value-
of select="@name"/>
3032N/A <
xsl:
attribute name="align">
3032N/A <
xsl:
value-
of select="'center'"/>
3032N/A <
xsl:
value-
of select="testcase/@start[1]"/>
3032N/A <
xsl:
attribute name="align">
3032N/A <
xsl:
value-
of select="'center'"/>
3032N/A <
xsl:
value-
of select="$end-time"/>
3032N/A <
xsl:
attribute name="align">
3032N/A <
xsl:
value-
of select="'center'"/>
3032N/A <
xsl:
value-
of select="concat($duration,'s')"/>
3032N/A <
xsl:
attribute name="align">
3032N/A <
xsl:
value-
of select="'center'"/>
3032N/A <
xsl:
value-
of select="$test-num"/>
3032N/A <
xsl:
attribute name="align">
3032N/A <
xsl:
value-
of select="'center'"/>
3032N/A <
xsl:
value-
of select="$test-pass"/>
3032N/A <
xsl:
attribute name="align">
3032N/A <
xsl:
value-
of select="'center'"/>
3032N/A <
xsl:
value-
of select="$test-fail"/>
3032N/A <
xsl:
attribute name="align">
3032N/A <
xsl:
value-
of select="'center'"/>
3032N/A <
xsl:
value-
of select="$test-inc"/>
3292N/A <
xsl:
attribute name="align">
3292N/A <
xsl:
value-
of select="'center'"/>
3292N/A <
xsl:
value-
of select="$test-kfail"/>
3032N/A <
xsl:
attribute name="align">
3032N/A <
xsl:
value-
of select="'center'"/>
3032N/A <
xsl:
value-
of select="concat($test-percent,'%')"/>
3032N/A <
xsl:
attribute name="noshade">
3032N/A <
xsl:
value-
of select="'noshade'"/>
3032N/A <
xsl:
attribute name="size">
3032N/A <!-- Additional Information --> 3032N/A <
xsl:
value-
of select="'Additional Information'"/>
3032N/A <
xsl:
value-
of select="'Test Archive: '"/>
3270N/A <
xsl:
attribute name="href">
3270N/A <
xsl:
value-
of select="concat($url,$tests-dir)"/>
3826N/A <
xsl:
value-
of select="concat($url,$tests-dir)"/>
3826N/A <
xsl:
value-
of select="'Product Identification: '"/>
3826N/A <
xsl:
attribute name="href">
3826N/A <
xsl:
value-
of select="'Mail Sent to: '"/>
3826N/A <
xsl:
attribute name="href">
3826N/A <
xsl:
value-
of select="concat('mailto:',normalize-space($mailto))"/>
3826N/A <
xsl:
value-
of select="normalize-space($mailto)"/>
3032N/A <
xsl:
attribute name="noshade">
3032N/A <
xsl:
value-
of select="'noshade'"/>
3032N/A <
xsl:
attribute name="size">
3032N/A<
xsl:
template name="countDuration">
3032N/A <
xsl:
param name="testList"/>
3032N/A <
xsl:
when test="$testList">
3032N/A <
xsl:
variable name="recursive_result">
3032N/A <
xsl:
call-
template name="countDuration">
3032N/A <
xsl:
with-
param name="testList" 3032N/A select="$testList[position() > 1]"/>
3032N/A select="number($testList[1]/@duration) + $recursive_result"/>
3032N/A <
xsl:
otherwise><
xsl:
value-
of select="0"/></
xsl:
otherwise>
3032N/A<
xsl:
template name="setColour">
3032N/A <
xsl:
param name="percent"/>
3032N/A <
xsl:
attribute name="bgcolor">
3270N/A <
xsl:
when test="$percent < $red">
3032N/A <
xsl:
value-
of select="'red'" />
3270N/A <
xsl:
when test="$percent < $yellow">
3032N/A <
xsl:
value-
of select="'yellow'" />
3032N/A <
xsl:
value-
of select="'lightgreen'" />