diff options
Diffstat (limited to 'build/tools/gallio/Reports')
23 files changed, 1581 insertions, 0 deletions
diff --git a/build/tools/gallio/Reports/Gallio.Reports.dll b/build/tools/gallio/Reports/Gallio.Reports.dll Binary files differnew file mode 100644 index 0000000..8850321 --- /dev/null +++ b/build/tools/gallio/Reports/Gallio.Reports.dll diff --git a/build/tools/gallio/Reports/Gallio.Reports.plugin b/build/tools/gallio/Reports/Gallio.Reports.plugin new file mode 100644 index 0000000..ff07968 --- /dev/null +++ b/build/tools/gallio/Reports/Gallio.Reports.plugin @@ -0,0 +1,138 @@ +<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+ <castle>
+ <components>
+ <component id="ReportFormatter.Xml"
+ service="Gallio.Runner.Reports.IReportFormatter, Gallio"
+ type="Gallio.Reports.XmlReportFormatter, Gallio.Reports">
+ <parameters>
+ <name>Xml</name>
+ <description>Generates XML reports with linked attachment files.</description>
+ <defaultAttachmentContentDisposition>Link</defaultAttachmentContentDisposition>
+ </parameters>
+ </component>
+
+ <component id="ReportFormatter.Xml-Inline"
+ service="Gallio.Runner.Reports.IReportFormatter, Gallio"
+ type="Gallio.Reports.XmlReportFormatter, Gallio.Reports">
+ <parameters>
+ <name>Xml-Inline</name>
+ <description>Generates XML reports with inline encoded attachments.</description>
+ <defaultAttachmentContentDisposition>Inline</defaultAttachmentContentDisposition>
+ </parameters>
+ </component>
+
+ <component id="ReportFormatter.Text"
+ service="Gallio.Runner.Reports.IReportFormatter, Gallio"
+ type="Gallio.Reports.XsltReportFormatter, Gallio.Reports">
+ <parameters>
+ <name>Text</name>
+ <description>Generates plain text reports.</description>
+ <extension>txt</extension>
+ <contentType>text/plain</contentType>
+ <defaultAttachmentContentDisposition>Absent</defaultAttachmentContentDisposition>
+ <contentUri>plugin://Gallio.Reports/</contentUri>
+ <xsltPath>xsl/Gallio-Report.txt.xsl</xsltPath>
+ <resourcePaths>
+ <array>
+ </array>
+ </resourcePaths>
+ </parameters>
+ </component>
+
+ <component id="ReportFormatter.Html"
+ service="Gallio.Runner.Reports.IReportFormatter, Gallio"
+ type="Gallio.Reports.XsltReportFormatter, Gallio.Reports">
+ <parameters>
+ <name>Html</name>
+ <description>Generates HTML reports with linked attachment files.</description>
+ <extension>html</extension>
+ <contentType>text/html</contentType>
+ <defaultAttachmentContentDisposition>Link</defaultAttachmentContentDisposition>
+ <contentUri>plugin://Gallio.Reports/</contentUri>
+ <xsltPath>xsl/Gallio-Report.html.xsl</xsltPath>
+ <resourcePaths>
+ <array>
+ <item>css</item>
+ <item>js</item>
+ <item>img</item>
+ </array>
+ </resourcePaths>
+ </parameters>
+ </component>
+
+ <component id="ReportFormatter.Html-Inline"
+ service="Gallio.Runner.Reports.IReportFormatter, Gallio"
+ type="Gallio.Reports.XsltReportFormatter, Gallio.Reports">
+ <parameters>
+ <name>Html-Inline</name>
+ <description>Generates HTML reports with inline encoded attachments (images only).</description>
+ <extension>html</extension>
+ <contentType>text/html</contentType>
+ <defaultAttachmentContentDisposition>Inline</defaultAttachmentContentDisposition>
+ <contentUri>plugin://Gallio.Reports/</contentUri>
+ <xsltPath>xsl/Gallio-Report.html.xsl</xsltPath>
+ <resourcePaths>
+ <array>
+ <item>css</item>
+ <item>js</item>
+ <item>img</item>
+ </array>
+ </resourcePaths>
+ </parameters>
+ </component>
+
+ <component id="ReportFormatter.XHtml"
+ service="Gallio.Runner.Reports.IReportFormatter, Gallio"
+ type="Gallio.Reports.XsltReportFormatter, Gallio.Reports">
+ <parameters>
+ <name>XHtml</name>
+ <description>Generates XHTML reports with linked attachment files.</description>
+ <extension>xhtml</extension>
+ <contentType>text/xhtml+xml</contentType>
+ <defaultAttachmentContentDisposition>Link</defaultAttachmentContentDisposition>
+ <contentUri>plugin://Gallio.Reports/</contentUri>
+ <xsltPath>xsl/Gallio-Report.xhtml.xsl</xsltPath>
+ <resourcePaths>
+ <array>
+ <item>css</item>
+ <item>js</item>
+ <item>img</item>
+ </array>
+ </resourcePaths>
+ </parameters>
+ </component>
+
+ <component id="ReportFormatter.XHtml-Inline"
+ service="Gallio.Runner.Reports.IReportFormatter, Gallio"
+ type="Gallio.Reports.XsltReportFormatter, Gallio.Reports">
+ <parameters>
+ <name>XHtml-Inline</name>
+ <description>Generates XHTML reports with inline encoded attachments (images only).</description>
+ <extension>xhtml</extension>
+ <contentType>text/xhtml+xml</contentType>
+ <defaultAttachmentContentDisposition>Inline</defaultAttachmentContentDisposition>
+ <contentUri>plugin://Gallio.Reports/</contentUri>
+ <xsltPath>xsl/Gallio-Report.xhtml.xsl</xsltPath>
+ <resourcePaths>
+ <array>
+ <item>css</item>
+ <item>js</item>
+ <item>img</item>
+ </array>
+ </resourcePaths>
+ </parameters>
+ </component>
+
+ <component id="ReportFormatter.MHtml"
+ service="Gallio.Runner.Reports.IReportFormatter, Gallio"
+ type="Gallio.Reports.MHtmlReportFormatter, Gallio.Reports">
+ <parameters>
+ <name>MHtml</name>
+ <description>Generates MHTML reports with embedded attachments.</description>
+ <htmlReportFormatter>${ReportFormatter.Html}</htmlReportFormatter>
+ </parameters>
+ </component>
+ </components>
+ </castle>
+</configuration>
diff --git a/build/tools/gallio/Reports/Readme.txt b/build/tools/gallio/Reports/Readme.txt new file mode 100644 index 0000000..7bd8e0a --- /dev/null +++ b/build/tools/gallio/Reports/Readme.txt @@ -0,0 +1,16 @@ +Reports Plugin
+==============
+
+This plugin provides multiple report formats for generating Gallio reports.
+Additional report formats can be added in several ways:
+
+1. Adding or modifying XSLT stylesheets and registering them in the
+ Gallio.Reports.plugin file as additional XsltReportFormatter
+ components similar to the existing ones.
+
+2. Adding new implementations of IReportFormatter to the assembly
+ and registering them in the Gallio.Reports.plugin file
+ in similar fashion to the XmlReportFormatter.
+
+3. Creating a new Gallio plugin and registering components that implement
+ the IReportFormatter interface just like XmlReportFormatter.
diff --git a/build/tools/gallio/Reports/css/Gallio-Report.css b/build/tools/gallio/Reports/css/Gallio-Report.css new file mode 100644 index 0000000..8fff163 --- /dev/null +++ b/build/tools/gallio/Reports/css/Gallio-Report.css @@ -0,0 +1,329 @@ +.gallio-report body
+{
+ margin: 0px 0px 0px 0px;
+ padding: 0px 0px 0px 0px;
+ font-family: Verdana, Arial, Helvetica, Helv, sans-serif;
+ font-size: 10pt;
+}
+
+.gallio-report div#header
+{
+ margin: 0px 0px 0px 0px;
+ padding: 0px 0px 0px 0px;
+ background-color: #95b0be;
+ background-image: url(../img/header-background.gif);
+ background-repeat: repeat-y;
+ width: 100%;
+ height: 60px; /*border: solid 1px red;*/
+}
+
+.gallio-report h1
+{
+ font-size: 18pt;
+ letter-spacing: 0.2em;
+ font-weight: normal;
+ width: 100%;
+ height: 60px;
+ background-image: url(../img/GallioTestReportHeader.png);
+ background-repeat: no-repeat;
+ background-position: 0 0;
+ color: White;
+ text-indent: 110px;/*border: solid 1px white;*/
+ padding-top: 15px;
+}
+
+.gallio-report h2
+{
+ font-size: 13pt;
+ letter-spacing: 0.15em;
+ color: #1f1f1f;
+ /*text-decoration: underline;*/
+ /* font-weight: normal;*/
+ /*padding: 8px;*/
+ padding: 0;
+ margin: 0 0 3px 0;
+ text-indent: 8px;
+}
+
+.gallio-report h3
+{
+ font-size: 10pt;
+}
+
+.gallio-report ul
+{
+ list-style-type: none;
+ padding-left: 0px;
+ margin-left: 24px;
+}
+
+.gallio-report ul.testStepRunContainer
+{
+ margin-left: 12px;
+}
+
+
+/* Progress bars */
+.gallio-report table.progressBar
+{
+ display: inline;
+ vertical-align: middle;
+}
+
+.gallio-report div.progressBar
+{
+ overflow: hidden;
+
+ background-color: #DDDDDD;
+ border: solid 1px #000000;
+ padding: 0px 0px 0px 0px;
+ margin: 0px 0px 0px 0px;
+
+ height: 8px;
+ width: 72px;
+}
+
+.gallio-report .progress-passed
+{
+ height:100%;
+ float:left;
+ background-color: #008000;
+}
+
+.gallio-report .progress-failed
+{
+ height:100%;
+ float:left;
+ background-color: #ff0000;
+}
+
+.gallio-report .progress-inconclusive
+{
+ height:100%;
+ float:left;
+ background-color: #ffff00;
+}
+
+.gallio-report .progress-skipped
+{
+ height:100%;
+ float:left;
+ background-color: #dddddd;
+}
+
+/* Outcome bar */
+.gallio-report table.outcomeBar
+{
+ display: inline;
+ vertical-align: middle;
+}
+
+.gallio-report div.outcomeBar
+{
+ overflow: hidden;
+
+ border: solid 1px #000000;
+ padding: 0px 0px 0px 0px;
+ margin: 0px 0px 0px 0px;
+
+ height: 6px;
+ width: 20px;
+}
+
+.gallio-report .outcome-passed
+{
+ background-color: #008000;
+}
+
+.gallio-report .outcome-failed
+{
+ background-color: #ff0000;
+}
+
+.gallio-report .outcome-inconclusive
+{
+ background-color: #ffff00;
+}
+
+.gallio-report .outcome-skipped
+{
+ background-color: #dddddd;
+}
+
+/* Toggles */
+.gallio-report .toggle
+{
+ cursor: pointer;
+}
+
+/* Styles for test runs, including customized varieties per component kind */
+.gallio-report .testStepRun
+{
+ margin-top: 12pt;
+ font-size: 10pt;
+}
+
+.gallio-report .testStepRunHeading
+{
+ font-weight:bold;
+ font-size:10pt;
+ position:relative;
+}
+
+.gallio-report .testStepRunHeading-Level1
+{
+ font-size:11pt;
+}
+
+.gallio-report .testStepRunHeading-Level2
+{
+ font-size:10pt;
+}
+
+.gallio-report .testStepRunHeading-Level3
+{
+ font-size:10pt;
+}
+
+.gallio-report .testStepRunHeading-Level4
+{
+ font-size:10pt;
+}
+
+.gallio-report .testStepRunPanel
+{
+ margin-left: 12pt;
+}
+
+/* Styles for metadata entries */
+.gallio-report .metadata
+{
+ margin: 5px 5px 5px 0px;
+ padding: 5px 5px 5px 5px;
+
+ /*border: solid 1px #505090;*/
+ background: #f4f4ff;
+ font-size: 9pt;
+}
+
+/* Styles used for execution logs */
+.gallio-report .log
+{
+ margin: 5px 0px 5px 0px;
+}
+
+.gallio-report .logAttachmentList
+{
+ font-size: 10pt;
+ font-style: italic;
+}
+
+.gallio-report .logAttachmentEmbedding
+{
+ font-size: 10pt;
+ font-style: italic;
+ padding: 5px 10px 5px 10px;
+}
+
+.gallio-report .logStream
+{
+ background-color: #f0f0f0;
+ /*border: dotted 1px #505050;*/
+ border-bottom: solid 1px #c6c6c6;
+ border-right: solid 1px #c6c6c6;
+ margin: 5px 5px 5px 0px;
+ padding: 5px 5px 5px 5px;
+}
+
+.gallio-report .logStreamHeading
+{
+ font-weight:bold;
+ font-size: 9pt;
+ text-decoration: underline;
+}
+
+.gallio-report .logStreamBody
+{
+ font-size: 10pt;
+ border-style: none;
+}
+
+.gallio-report .logStreamSection
+{
+ margin-top: 12pt;
+ margin-bottom: 12pt;
+ padding-left: 6px;
+ border-left: solid 3px black;
+}
+
+.gallio-report .logStreamSectionHeading
+{
+ font-size: 10pt;
+ font-weight: bold;
+ text-decoration: underline;
+}
+
+/* Styles used for coloring different named streams */
+.gallio-report .logStream-Failures
+{
+ background-color: #ffd8d8;
+ border: dotted 1px #905050;
+}
+
+.gallio-report .logStream-Warnings
+{
+ background-color: #ffffc8;
+ border: dotted 1px #909050;
+}
+
+
+.gallio-report div.section
+{
+ background-color: #ebeaea;
+ margin: 5px;
+ padding: 10px;
+ border-bottom: solid 1px #dcdcdc;
+ border-right: solid 1px #dcdcdc;
+}
+
+.gallio-report div.section-content
+{
+ background-color: #fbfbfb;
+ padding-top: 3px;
+ padding-bottom: 3px;
+}
+
+.gallio-report table.statistics-table
+{
+ width: 99%;
+ margin: 0 20px 0 0;
+ /*border: solid 1px red;*/
+ border-collapse: collapse;
+}
+
+.gallio-report table.statistics-table td.statistics-label-cell
+{
+ font-weight: bolder;
+ color: #646464;
+ padding: 0 10x 0 10px;
+ /*text-align: right;*/
+}
+
+.gallio-report table.statistics-table tr.alternate-row td
+{
+ background-color: #f2f2f2;
+}
+
+.gallio-report div#statistics-section-content
+{
+ padding: 10px 20px 10px 20px;
+}
+
+.gallio-report div#statistics-section-content table.statistics-table
+{
+ width: 100%;
+}
+.gallio-report span.outcome-icons
+{
+ font-size: 11pt;
+}
\ No newline at end of file diff --git a/build/tools/gallio/Reports/img/Container.png b/build/tools/gallio/Reports/img/Container.png Binary files differnew file mode 100644 index 0000000..105c054 --- /dev/null +++ b/build/tools/gallio/Reports/img/Container.png diff --git a/build/tools/gallio/Reports/img/Failed.gif b/build/tools/gallio/Reports/img/Failed.gif Binary files differnew file mode 100644 index 0000000..bcf4c07 --- /dev/null +++ b/build/tools/gallio/Reports/img/Failed.gif diff --git a/build/tools/gallio/Reports/img/Fixture.png b/build/tools/gallio/Reports/img/Fixture.png Binary files differnew file mode 100644 index 0000000..9fbddd8 --- /dev/null +++ b/build/tools/gallio/Reports/img/Fixture.png diff --git a/build/tools/gallio/Reports/img/FullStop.gif b/build/tools/gallio/Reports/img/FullStop.gif Binary files differnew file mode 100644 index 0000000..dda8c62 --- /dev/null +++ b/build/tools/gallio/Reports/img/FullStop.gif diff --git a/build/tools/gallio/Reports/img/GallioTestReportHeader.png b/build/tools/gallio/Reports/img/GallioTestReportHeader.png Binary files differnew file mode 100644 index 0000000..111cca6 --- /dev/null +++ b/build/tools/gallio/Reports/img/GallioTestReportHeader.png diff --git a/build/tools/gallio/Reports/img/Ignored.gif b/build/tools/gallio/Reports/img/Ignored.gif Binary files differnew file mode 100644 index 0000000..dd90f46 --- /dev/null +++ b/build/tools/gallio/Reports/img/Ignored.gif diff --git a/build/tools/gallio/Reports/img/Logo.png b/build/tools/gallio/Reports/img/Logo.png Binary files differnew file mode 100644 index 0000000..874a2a7 --- /dev/null +++ b/build/tools/gallio/Reports/img/Logo.png diff --git a/build/tools/gallio/Reports/img/Minus.gif b/build/tools/gallio/Reports/img/Minus.gif Binary files differnew file mode 100644 index 0000000..46acbcc --- /dev/null +++ b/build/tools/gallio/Reports/img/Minus.gif diff --git a/build/tools/gallio/Reports/img/Passed.gif b/build/tools/gallio/Reports/img/Passed.gif Binary files differnew file mode 100644 index 0000000..1dee9cd --- /dev/null +++ b/build/tools/gallio/Reports/img/Passed.gif diff --git a/build/tools/gallio/Reports/img/Plus.gif b/build/tools/gallio/Reports/img/Plus.gif Binary files differnew file mode 100644 index 0000000..0ce509a --- /dev/null +++ b/build/tools/gallio/Reports/img/Plus.gif diff --git a/build/tools/gallio/Reports/img/Test.png b/build/tools/gallio/Reports/img/Test.png Binary files differnew file mode 100644 index 0000000..16ce088 --- /dev/null +++ b/build/tools/gallio/Reports/img/Test.png diff --git a/build/tools/gallio/Reports/img/header-background.gif b/build/tools/gallio/Reports/img/header-background.gif Binary files differnew file mode 100644 index 0000000..0e01c4c --- /dev/null +++ b/build/tools/gallio/Reports/img/header-background.gif diff --git a/build/tools/gallio/Reports/js/Gallio-Report.js b/build/tools/gallio/Reports/js/Gallio-Report.js new file mode 100644 index 0000000..d5d7988 --- /dev/null +++ b/build/tools/gallio/Reports/js/Gallio-Report.js @@ -0,0 +1,24 @@ +function toggle(id)
+{
+ var icon = document.getElementById('toggle-' + id);
+ if (icon != null)
+ {
+ var childElement = document.getElementById(id);
+ if (icon.src.indexOf('Plus.gif') != -1)
+ {
+ icon.src = icon.src.replace('Plus.gif', 'Minus.gif');
+ if (childElement != null)
+ {
+ childElement.style.display = "block";
+ }
+ }
+ else
+ {
+ icon.src = icon.src.replace('Minus.gif', 'Plus.gif');
+ if (childElement != null)
+ {
+ childElement.style.display = "none";
+ }
+ }
+ }
+}
\ No newline at end of file diff --git a/build/tools/gallio/Reports/xsl/Gallio-Report.ccnet-details.xsl b/build/tools/gallio/Reports/xsl/Gallio-Report.ccnet-details.xsl new file mode 100644 index 0000000..260cdfc --- /dev/null +++ b/build/tools/gallio/Reports/xsl/Gallio-Report.ccnet-details.xsl @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:g="http://www.gallio.org/"> + <xsl:output method="html" indent="yes" encoding="utf-8" omit-xml-declaration="yes" /> + <xsl:param name="resourceRoot" select="''" /> + + <xsl:variable name="cssDir">/gallio/css/</xsl:variable> + <xsl:variable name="jsDir">/gallio/js/</xsl:variable> + <xsl:variable name="imgDir">/gallio/img/</xsl:variable> + <xsl:variable name="attachmentBrokerUrl">GallioAttachment.aspx?</xsl:variable> + + <xsl:template match="/"> + <xsl:apply-templates select="//g:report" mode="html-fragment" /> + </xsl:template> + + <!-- Include the base HTML / XHTML report template --> + <xsl:include href="Gallio-Report.html+xhtml.xsl" /> +</xsl:stylesheet> diff --git a/build/tools/gallio/Reports/xsl/Gallio-Report.common.xsl b/build/tools/gallio/Reports/xsl/Gallio-Report.common.xsl new file mode 100644 index 0000000..82a8f9e --- /dev/null +++ b/build/tools/gallio/Reports/xsl/Gallio-Report.common.xsl @@ -0,0 +1,231 @@ +<?xml version="1.0" encoding="utf-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:msxsl="urn:schemas-microsoft-com:xslt"
+ xmlns:g="http://www.gallio.org/"
+ xmlns="http://www.w3.org/1999/xhtml">
+ <!-- Common utility functions -->
+
+ <!-- Formats a statistics line like 5 run, 3 passed, 2 failed (1 error), 0 inconclusive, 2 skipped -->
+ <xsl:template name="format-statistics">
+ <xsl:param name="statistics" />
+
+ <xsl:value-of select="$statistics/@runCount"/>
+ <xsl:text> run, </xsl:text>
+
+ <xsl:value-of select="$statistics/@passedCount"/>
+ <xsl:text> passed</xsl:text>
+ <xsl:call-template name="format-statistics-category-counts">
+ <xsl:with-param name="statistics" select="$statistics" />
+ <xsl:with-param name="status">passed</xsl:with-param>
+ </xsl:call-template>
+ <xsl:text>, </xsl:text>
+
+ <xsl:value-of select="$statistics/@failedCount"/>
+ <xsl:text> failed</xsl:text>
+ <xsl:call-template name="format-statistics-category-counts">
+ <xsl:with-param name="statistics" select="$statistics" />
+ <xsl:with-param name="status">failed</xsl:with-param>
+ </xsl:call-template>
+ <xsl:text>, </xsl:text>
+
+ <xsl:value-of select="$statistics/@inconclusiveCount"/>
+ <xsl:text> inconclusive</xsl:text>
+ <xsl:call-template name="format-statistics-category-counts">
+ <xsl:with-param name="statistics" select="$statistics" />
+ <xsl:with-param name="status">inconclusive</xsl:with-param>
+ </xsl:call-template>
+ <xsl:text>, </xsl:text>
+
+ <xsl:value-of select="$statistics/@skippedCount"/>
+ <xsl:text> skipped</xsl:text>
+ <xsl:call-template name="format-statistics-category-counts">
+ <xsl:with-param name="statistics" select="$statistics" />
+ <xsl:with-param name="status">skipped</xsl:with-param>
+ </xsl:call-template>
+ </xsl:template>
+
+ <xsl:template name="format-statistics-category-counts">
+ <xsl:param name="statistics" />
+ <xsl:param name="status" />
+
+ <xsl:variable name="outcomeSummaries" select="$statistics/g:outcomeSummaries/g:outcomeSummary[g:outcome/@status=$status and g:outcome/@category]" />
+
+ <xsl:if test="$outcomeSummaries">
+ <xsl:text> (</xsl:text>
+ <xsl:for-each select="$outcomeSummaries">
+ <xsl:sort data-type="text" order="ascending" select="g:outcome/@category"/>
+
+ <xsl:if test="position() != 1"><xsl:text>, </xsl:text></xsl:if>
+ <xsl:value-of select="@count"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="g:outcome/@category"/>
+ </xsl:for-each>
+ <xsl:text>)</xsl:text>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- Creates an aggregate statistics summary from a test instance run and its descendants -->
+ <xsl:template name="aggregate-statistics">
+ <xsl:param name="test" />
+ <xsl:param name="testStepRun" />
+
+ <xsl:variable name="testCaseResults" select="$testStepRun/descendant-or-self::g:testStepRun[g:testStep/@isTestCase='true']/g:result" />
+ <xsl:variable name="testCaseOutcomes" select="$testCaseResults/g:outcome" />
+
+ <xsl:variable name="skippedOutcomes" select="$testCaseOutcomes[@status = 'skipped']" />
+ <xsl:variable name="passedOutcomes" select="$testCaseOutcomes[@status = 'passed']" />
+ <xsl:variable name="inconclusiveOutcomes" select="$testCaseOutcomes[@status = 'inconclusive']" />
+ <xsl:variable name="failedOutcomes" select="$testCaseOutcomes[@status = 'failed']" />
+
+ <xsl:variable name="skippedCount" select="count($skippedOutcomes)"/>
+ <xsl:variable name="passedCount" select="count($passedOutcomes)"/>
+ <xsl:variable name="inconclusiveCount" select="count($inconclusiveOutcomes)"/>
+ <xsl:variable name="failedCount" select="count($failedOutcomes)"/>
+
+ <g:statistics>
+ <xsl:attribute name="duration"><xsl:value-of select="$testStepRun/g:result/@duration"/></xsl:attribute>
+ <xsl:attribute name="assertCount"><xsl:value-of select="sum($testCaseResults/@assertCount)"/></xsl:attribute>
+
+ <xsl:attribute name="skippedCount"><xsl:value-of select="$skippedCount"/></xsl:attribute>
+ <xsl:attribute name="passedCount"><xsl:value-of select="$passedCount"/></xsl:attribute>
+ <xsl:attribute name="inconclusiveCount"><xsl:value-of select="$inconclusiveCount"/></xsl:attribute>
+ <xsl:attribute name="failedCount"><xsl:value-of select="$failedCount"/></xsl:attribute>
+
+ <xsl:attribute name="runCount"><xsl:value-of select="$passedCount + $inconclusiveCount + $failedCount"/></xsl:attribute>
+
+ <g:outcomeSummaries>
+ <xsl:call-template name="aggregate-statistics-outcome-summaries">
+ <xsl:with-param name="status">skipped</xsl:with-param>
+ <xsl:with-param name="outcomes" select="$skippedOutcomes" />
+ </xsl:call-template>
+ <xsl:call-template name="aggregate-statistics-outcome-summaries">
+ <xsl:with-param name="status">passed</xsl:with-param>
+ <xsl:with-param name="outcomes" select="$passedOutcomes" />
+ </xsl:call-template>
+ <xsl:call-template name="aggregate-statistics-outcome-summaries">
+ <xsl:with-param name="status">inconclusive</xsl:with-param>
+ <xsl:with-param name="outcomes" select="$inconclusiveOutcomes" />
+ </xsl:call-template>
+ <xsl:call-template name="aggregate-statistics-outcome-summaries">
+ <xsl:with-param name="status">failed</xsl:with-param>
+ <xsl:with-param name="outcomes" select="$failedOutcomes" />
+ </xsl:call-template>
+ </g:outcomeSummaries>
+ </g:statistics>
+ </xsl:template>
+
+ <xsl:key name="outcome-category" match="g:outcome" use="@category" />
+ <xsl:template name="aggregate-statistics-outcome-summaries">
+ <xsl:param name="status" />
+ <xsl:param name="outcomes" />
+
+ <xsl:for-each select="$outcomes[generate-id() = generate-id(key('outcome-category', @category)[1])]">
+ <xsl:variable name="category" select="@category" />
+ <g:outcomeSummary count="{count($outcomes[@category = $category])}">
+ <g:outcome status="{$status}" category="{$category}" />
+ </g:outcomeSummary>
+ </xsl:for-each>
+ </xsl:template>
+
+ <!-- Indents text using the specified prefix -->
+ <xsl:template name="indent">
+ <xsl:param name="str" />
+ <xsl:param name="prefix" select="' '" />
+
+ <xsl:if test="$str!=''">
+ <xsl:call-template name="indent-recursive">
+ <xsl:with-param name="str" select="translate($str, '	

', ' 
')" />
+ <xsl:with-param name="prefix" select="$prefix" />
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="indent-recursive">
+ <xsl:param name="str" />
+ <xsl:param name="prefix" />
+
+ <xsl:variable name="line" select="substring-before($str, '
')" />
+ <xsl:choose>
+ <xsl:when test="$line!=''">
+ <xsl:value-of select="$prefix"/>
+ <xsl:value-of select="$line"/>
+ <xsl:text>
</xsl:text>
+ <xsl:call-template name="indent-recursive">
+ <xsl:with-param name="str" select="substring-after($str, '
')" />
+ <xsl:with-param name="prefix" select="$prefix" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$prefix"/>
+ <xsl:value-of select="$str"/>
+ <xsl:text>
</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- Prints text with <br/> elements -->
+ <xsl:template name="print-text-with-line-breaks">
+ <xsl:param name="text" />
+ <xsl:variable name="tail" select="substring-after($text, ' ')" />
+
+ <xsl:choose>
+ <xsl:when test="$tail!=''">
+ <xsl:value-of select="substring-before($text, ' ')" />
+ <br/>
+ <xsl:call-template name="print-text-with-line-breaks">
+ <xsl:with-param name="text" select="$tail" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$text" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- Pretty print date time values -->
+ <xsl:template name="format-datetime">
+ <xsl:param name="datetime" />
+ <xsl:value-of select="substring($datetime, 12, 8)" />, <xsl:value-of select="substring($datetime, 1, 10)" />
+ </xsl:template>
+
+ <!-- Namespace stripping adapted from http://www.xml.com/pub/a/2004/05/05/tr.html -->
+ <xsl:template name="strip-namespace">
+ <xsl:param name="nodes" />
+ <xsl:apply-templates select="msxsl:node-set($nodes)" mode="strip-namespace" />
+ </xsl:template>
+
+ <xsl:template match="*" mode="strip-namespace">
+ <xsl:element name="{local-name()}" namespace="">
+ <xsl:apply-templates select="@*|node()" mode="strip-namespace"/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="@*" mode="strip-namespace">
+ <xsl:attribute name="{local-name()}" namespace="">
+ <xsl:value-of select="."/>
+ </xsl:attribute>
+ </xsl:template>
+
+ <xsl:template match="processing-instruction()|comment()" mode="strip-namespace">
+ <xsl:copy>
+ <xsl:apply-templates select="node()" mode="strip-namespace"/>
+ </xsl:copy>
+ </xsl:template>
+
+ <!-- Converting paths to URIs -->
+ <xsl:template name="path-to-uri">
+ <xsl:param name="path" />
+ <xsl:if test="$path != ''">
+ <xsl:choose>
+ <xsl:when test="starts-with($path, '\')">/</xsl:when>
+ <xsl:when test="starts-with($path, ' ')">%20</xsl:when>
+ <xsl:when test="starts-with($path, '%')">%25</xsl:when>
+ <xsl:otherwise><xsl:value-of select="substring($path, 1, 1)"/></xsl:otherwise>
+ </xsl:choose>
+ <xsl:call-template name="path-to-uri">
+ <xsl:with-param name="path" select="substring($path, 2)" />
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/build/tools/gallio/Reports/xsl/Gallio-Report.html+xhtml.xsl b/build/tools/gallio/Reports/xsl/Gallio-Report.html+xhtml.xsl new file mode 100644 index 0000000..c68e2bc --- /dev/null +++ b/build/tools/gallio/Reports/xsl/Gallio-Report.html+xhtml.xsl @@ -0,0 +1,630 @@ +<?xml version="1.0" encoding="utf-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:msxsl="urn:schemas-microsoft-com:xslt"
+ xmlns:g="http://www.gallio.org/"
+ xmlns="http://www.w3.org/1999/xhtml">
+ <!-- This parameter configures whether progress bars show a proportional division
+ of color bars by status code or to show a single solid color -->
+ <xsl:param name="use-proportional-progress-bars" select="false" />
+
+ <xsl:template match="g:report" mode="xhtml-document">
+ <html xml:lang="en" lang="en" dir="ltr">
+ <head>
+ <title>Gallio Test Report</title>
+ <link rel="stylesheet" type="text/css" href="{$cssDir}Gallio-Report.css" />
+ <script type="text/javascript" src="{$jsDir}Gallio-Report.js">
+ <xsl:comment> comment inserted for Internet Explorer </xsl:comment>
+ </script>
+ </head>
+ <body class="gallio-report">
+ <xsl:apply-templates select="." mode="xhtml-body" />
+ </body>
+ </html>
+ </xsl:template>
+
+ <xsl:template match="g:report" mode="html-document">
+ <xsl:call-template name="strip-namespace">
+ <xsl:with-param name="nodes"><xsl:apply-templates select="." mode="xhtml-document" /></xsl:with-param>
+ </xsl:call-template>
+ </xsl:template>
+
+ <xsl:template match="g:report" mode="xhtml-fragment">
+ <div class="gallio-report">
+ <!-- Technically a link element should not appear outside of the "head"
+ but most browsers tolerate it and this gives us better out of the box
+ support in embedded environments like CCNet since no changes need to
+ be made to the stylesheets of the containing application.
+ -->
+ <link rel="stylesheet" type="text/css" href="{$cssDir}Gallio-Report.css" />
+ <script type="text/javascript" src="{$jsDir}Gallio-Report.js">
+ <xsl:comment> comment inserted for Internet Explorer </xsl:comment>
+ </script>
+
+ <xsl:apply-templates select="." mode="xhtml-body" />
+ </div>
+ </xsl:template>
+
+ <xsl:template match="g:report" mode="html-fragment">
+ <xsl:call-template name="strip-namespace">
+ <xsl:with-param name="nodes"><xsl:apply-templates select="." mode="xhtml-fragment" /></xsl:with-param>
+ </xsl:call-template>
+ </xsl:template>
+
+
+ <xsl:template match="g:report" mode="xhtml-body">
+ <div id="header">
+ <h1></h1>
+ </div>
+ <xsl:apply-templates select="g:package/g:assemblyFiles" />
+ <xsl:apply-templates select="g:packageRun" mode="statistics" />
+ <xsl:apply-templates select="g:packageRun" mode="summary"/>
+ <xsl:apply-templates select="g:packageRun" mode="details"/>
+ </xsl:template>
+
+ <xsl:template match="g:package/g:assemblyFiles">
+ <div id="Assemblies" class="section">
+ <h2>Assemblies</h2>
+ <div class="section-content">
+ <ul>
+ <xsl:for-each select="g:assemblyFile">
+ <li>
+ <xsl:value-of select="."/>
+ </li>
+ </xsl:for-each>
+ </ul>
+ </div>
+ </div>
+ </xsl:template>
+
+ <xsl:template match="g:packageRun" mode="statistics">
+ <div id="Statistics" class="section">
+ <h2>Statistics</h2>
+ <div id="statistics-section-content" class="section-content">
+ <table class="statistics-table">
+ <tr>
+ <td class="statistics-label-cell">
+ Start time:
+ </td>
+ <td>
+ <xsl:call-template name="format-datetime">
+ <xsl:with-param name="datetime" select="@startTime" />
+ </xsl:call-template>
+ </td>
+ </tr>
+ <tr class="alternate-row">
+ <td class="statistics-label-cell">
+ End time:
+ </td>
+ <td>
+ <xsl:call-template name="format-datetime">
+ <xsl:with-param name="datetime" select="@endTime" />
+ </xsl:call-template>
+ </td>
+ </tr>
+ <xsl:apply-templates select="g:statistics" />
+ </table>
+ </div>
+ </div>
+ </xsl:template>
+
+ <xsl:template match="g:statistics">
+ <tr>
+ <td class="statistics-label-cell">
+ Tests:
+ </td>
+ <td>
+ <xsl:value-of select="@testCount" /> (<xsl:value-of select="@stepCount" /> steps)
+ </td>
+ </tr>
+ <tr class="alternate-row">
+ <td class="statistics-label-cell">
+ Results:
+ </td>
+ <td>
+ <xsl:call-template name="format-statistics">
+ <xsl:with-param name="statistics" select="." />
+ </xsl:call-template>
+ </td>
+ </tr>
+ <tr>
+ <td class="statistics-label-cell">
+ Duration:
+ </td>
+ <td>
+ <xsl:value-of select="format-number(@duration, '0.00')" />s
+ </td>
+ </tr>
+ <tr class="alternate-row">
+ <td class="statistics-label-cell">
+ Assertions:
+ </td>
+ <td>
+ <xsl:value-of select="@assertCount" />
+ </td>
+ </tr>
+ </xsl:template>
+
+ <xsl:template match="g:packageRun" mode="summary">
+ <div id="Summary" class="section">
+ <h2>Summary</h2>
+ <div class="section-content">
+ <xsl:choose>
+ <xsl:when test="g:testStepRun/g:children/g:testStepRun">
+ <ul>
+ <xsl:apply-templates select="g:testStepRun/g:children/g:testStepRun" mode="summary" />
+ </ul>
+ </xsl:when>
+ <xsl:otherwise>
+ <em>This report does not contain any test runs.</em>
+ </xsl:otherwise>
+ </xsl:choose>
+ </div>
+ </div>
+ </xsl:template>
+
+ <xsl:template match="g:testStepRun" mode="summary">
+ <xsl:variable name="id" select="g:testStep/@id" />
+ <xsl:variable name="testId" select="g:testStep/@testId" />
+ <xsl:variable name="test" select="ancestor::g:report/g:testModel/descendant::g:test[@id = $testId]" />
+
+ <xsl:if test="g:testStep/@isTestCase='false'">
+ <xsl:variable name="statisticsRaw">
+ <xsl:call-template name="aggregate-statistics">
+ <xsl:with-param name="test" select="$test" />
+ <xsl:with-param name="testStepRun" select="." />
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="statistics" select="msxsl:node-set($statisticsRaw)/g:statistics" />
+
+ <li>
+ <div>
+ <xsl:choose>
+ <xsl:when test="g:children/g:testStepRun">
+ <xsl:call-template name="toggle">
+ <xsl:with-param name="href">summaryPanel-<xsl:value-of select="$id"/></xsl:with-param>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="toggle-stop" />
+ </xsl:otherwise>
+ </xsl:choose>
+
+ <!--
+ <xsl:call-template name="icon">
+ <xsl:with-param name="kind" select="$kind" />
+ </xsl:call-template>
+ -->
+
+ <a href="#testStepRun-{$id}"><xsl:value-of select="g:testStep/@name" /></a>
+
+ <xsl:call-template name="visual-statistics">
+ <xsl:with-param name="statistics" select="$statistics" />
+ </xsl:call-template>
+ </div>
+
+ <xsl:if test="g:children/g:testStepRun">
+ <ul id="summaryPanel-{$id}">
+ <xsl:apply-templates select="g:children/g:testStepRun" mode="summary" />
+ </ul>
+ </xsl:if>
+ </li>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="g:packageRun" mode="details">
+ <div id="Details" class="section">
+ <h2>Details</h2>
+ <div class="section-content">
+ <xsl:choose>
+ <xsl:when test="g:testStepRun/g:children/g:testStepRun">
+ <ul class="testStepRunContainer">
+ <xsl:apply-templates select="g:testStepRun/g:children/g:testStepRun" mode="details" />
+ </ul>
+ </xsl:when>
+ <xsl:otherwise>
+ <em>This report does not contain any test runs.</em>
+ </xsl:otherwise>
+ </xsl:choose>
+ </div>
+ </div>
+ </xsl:template>
+
+ <xsl:template match="g:testStepRun" mode="details">
+ <xsl:variable name="id" select="g:testStep/@id" />
+ <xsl:variable name="testId" select="g:testStep/@testId" />
+ <xsl:variable name="test" select="ancestor::g:report/g:testModel/descendant::g:test[@id = $testId]" />
+
+ <xsl:variable name="metadataEntriesFromTest" select="$test/g:metadata/g:entry" />
+ <xsl:variable name="metadataEntriesFromTestStep" select="g:testStep/g:metadata/g:entry" />
+
+ <xsl:variable name="kind" select="$metadataEntriesFromTest[@key='TestKind']/g:value" />
+ <xsl:variable name="nestingLevel" select="count(ancestor::g:testStepRun)" />
+
+ <xsl:variable name="statisticsRaw">
+ <xsl:call-template name="aggregate-statistics">
+ <xsl:with-param name="test" select="$test" />
+ <xsl:with-param name="testStepRun" select="." />
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="statistics" select="msxsl:node-set($statisticsRaw)/g:statistics" />
+
+ <li id="testStepRun-{$id}">
+ <div class="testStepRunHeading testStepRunHeading-Level{$nestingLevel}">
+ <xsl:call-template name="toggle">
+ <xsl:with-param name="href">testStepRunPanel-<xsl:value-of select="$id"/></xsl:with-param>
+ </xsl:call-template>
+ <!--
+ <xsl:call-template name="icon">
+ <xsl:with-param name="kind" select="$kind" />
+ </xsl:call-template>
+ -->
+
+ <xsl:value-of select="g:testStep/@name" />
+
+ <xsl:choose>
+ <xsl:when test="g:children/g:testStepRun">
+ <xsl:call-template name="visual-statistics">
+ <xsl:with-param name="statistics" select="$statistics" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="outcomeBar">
+ <xsl:with-param name="status" select="g:result/g:outcome/@status" />
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </div>
+
+ <div id="testStepRunPanel-{$id}" class="testStepRunPanel">
+ <xsl:choose>
+ <xsl:when test="$kind = 'Assembly' or $kind = 'Framework'">
+ <table class="statistics-table">
+ <tr class="alternate-row">
+ <td>Results:</td>
+ <td>
+ <xsl:call-template name="format-statistics">
+ <xsl:with-param name="statistics" select="$statistics" />
+ </xsl:call-template>
+ </td>
+ </tr>
+ <tr>
+ <td>Duration:</td>
+ <td>
+ <xsl:value-of select="format-number($statistics/@duration, '0.00')" />s
+ </td>
+ </tr>
+ <tr class="alternate-row">
+ <td>
+ Assertions:
+ </td>
+ <td>
+ <xsl:value-of select="$statistics/@assertCount" />
+ </td>
+ </tr>
+ </table>
+ </xsl:when>
+ <xsl:otherwise>
+ Duration: <xsl:value-of select="format-number($statistics/@duration, '0.00')" />s,
+ Assertions: <xsl:value-of select="$statistics/@assertCount"/>.
+ </xsl:otherwise>
+ </xsl:choose>
+
+ <xsl:choose>
+ <xsl:when test="g:testStep/@isPrimary='true'">
+ <xsl:call-template name="print-metadata-entries">
+ <xsl:with-param name="entries" select="$metadataEntriesFromTest|$metadataEntriesFromTestStep" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="print-metadata-entries">
+ <xsl:with-param name="entries" select="$metadataEntriesFromTestStep" />
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ <div id="testStepRun-{g:testStepRun/g:testStep/@id}" class="testStepRun">
+ <xsl:apply-templates select="." mode="details-content" />
+ </div>
+
+ <xsl:if test="g:children/g:testStepRun">
+ <ul class="testStepRunContainer">
+ <xsl:apply-templates select="g:children/g:testStepRun" mode="details" />
+ </ul>
+ </xsl:if>
+ </div>
+ </li>
+ </xsl:template>
+
+ <xsl:template match="g:testStepRun" mode="details-content">
+ <xsl:apply-templates select="g:executionLog">
+ <xsl:with-param name="stepId" select="g:testStep/@id" />
+ </xsl:apply-templates>
+ </xsl:template>
+
+ <xsl:template match="g:metadata">
+ <xsl:call-template name="print-metadata-entries">
+ <xsl:with-param name="entries" select="g:entry" />
+ </xsl:call-template>
+ </xsl:template>
+
+ <xsl:template name="print-metadata-entries">
+ <xsl:param name="entries" />
+ <xsl:variable name="visibleEntries" select="$entries[@key != 'TestKind']" />
+
+ <xsl:if test="$visibleEntries">
+ <ul class="metadata">
+ <xsl:apply-templates select="$visibleEntries">
+ <xsl:sort select="translate(@key, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')" lang="en" data-type="text" />
+ <xsl:sort select="translate(@value, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')" lang="en" data-type="text" />
+ </xsl:apply-templates>
+ </ul>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="g:entry">
+ <li>
+ <xsl:value-of select="@key" />: <xsl:value-of select="g:value" />
+ </li>
+ </xsl:template>
+
+ <xsl:template match="g:executionLog">
+ <xsl:param name="stepId" />
+
+ <xsl:if test="g:streams/g:stream">
+ <div id="log-{$stepId}" class="log">
+ <xsl:apply-templates select="g:streams/g:stream" mode="stream">
+ <xsl:with-param name="attachments" select="g:attachments" />
+ </xsl:apply-templates>
+
+ <xsl:if test="g:attachments/g:attachment">
+ <div class="logAttachmentList">
+ Attachments: <xsl:for-each select="g:attachments/g:attachment">
+ <xsl:apply-templates select="." mode="link" /><xsl:if test="position() != last()">, </xsl:if>
+ </xsl:for-each>.
+ </div>
+ </xsl:if>
+ </div>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="g:streams/g:stream" mode="stream">
+ <xsl:param name="attachments" />
+
+ <div class="logStream logStream-{@name}">
+ <span class="logStreamHeading">
+ <xsl:value-of select="@name" />
+ </span>
+
+ <xsl:apply-templates select="g:body" mode="stream">
+ <xsl:with-param name="attachments" select="$attachments" />
+ </xsl:apply-templates>
+ </div>
+ </xsl:template>
+
+ <xsl:template match="g:body" mode="stream">
+ <xsl:param name="attachments" />
+
+ <div class="logStreamBody">
+ <xsl:apply-templates select="g:contents" mode="stream">
+ <xsl:with-param name="attachments" select="$attachments" />
+ </xsl:apply-templates>
+ </div>
+ </xsl:template>
+
+ <xsl:template match="g:section" mode="stream">
+ <xsl:param name="attachments" />
+
+ <div class="logStreamSection">
+ <span class="logStreamSectionHeading">
+ <xsl:value-of select="@name"/>
+ </span>
+ <div>
+ <xsl:apply-templates select="g:contents" mode="stream">
+ <xsl:with-param name="attachments" select="$attachments" />
+ </xsl:apply-templates>
+ </div>
+ </div>
+ </xsl:template>
+
+ <xsl:template match="g:contents" mode="stream">
+ <xsl:param name="attachments" />
+
+ <xsl:apply-templates select="child::node()[self::g:text or self::g:section or self::g:embed]" mode="stream">
+ <xsl:with-param name="attachments" select="$attachments" />
+ </xsl:apply-templates>
+ </xsl:template>
+
+ <xsl:template match="g:text" mode="stream">
+ <xsl:param name="attachments" />
+
+ <div>
+ <xsl:call-template name="print-text-with-line-breaks">
+ <xsl:with-param name="text" select="text()" />
+ </xsl:call-template>
+ </div>
+ </xsl:template>
+
+ <xsl:template match="g:embed" mode="stream">
+ <xsl:param name="attachments" />
+ <xsl:variable name="attachmentName" select="@attachmentName" />
+
+ <div class="logAttachmentEmbedding">
+ <xsl:apply-templates select="$attachments/g:attachment[@name=$attachmentName]" mode="embed" />
+ </div>
+ </xsl:template>
+
+ <xsl:template match="g:attachment" mode="embed">
+ <xsl:variable name="isImage" select="starts-with(@contentType, 'image/')" />
+ <xsl:choose>
+ <xsl:when test="$attachmentBrokerUrl != ''">
+ <xsl:variable name="attachmentBrokerQuery"><xsl:value-of select="$attachmentBrokerUrl"/>testStepId=<xsl:value-of select="../../../g:testStep/@id"/>&attachmentName=<xsl:value-of select="@name"/></xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$isImage">
+ <img src="{$attachmentBrokerQuery}" alt="Attachment: {@name}" />
+ </xsl:when>
+ <xsl:otherwise>
+ Attachment: <a href="{$attachmentBrokerQuery}"><xsl:value-of select="@name" /></a>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="@contentDisposition = 'link'">
+ <xsl:variable name="attachmentUri"><xsl:call-template name="path-to-uri"><xsl:with-param name="path" select="@contentPath" /></xsl:call-template></xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$isImage">
+ <img src="{$attachmentUri}" alt="Attachment: {@name}" />
+ </xsl:when>
+ <xsl:otherwise>
+ Attachment: <a href="{$attachmentUri}"><xsl:value-of select="@name" /></a>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="@contentDisposition = 'inline' and $isImage and @encoding = 'base64'">
+ <img src="data:{@contentType};base64,{text()}" alt="Attachment: {@name}" />
+ </xsl:when>
+ <xsl:otherwise>
+ Attachment: <xsl:value-of select="@name" /> (n/a)
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template match="g:attachment" mode="link">
+ <xsl:choose>
+ <xsl:when test="$attachmentBrokerUrl != ''">
+ <xsl:variable name="attachmentBrokerQuery"><xsl:value-of select="$attachmentBrokerUrl"/>testStepId=<xsl:value-of select="../../../g:testStep/@id"/>&attachmentName=<xsl:value-of select="@name"/></xsl:variable>
+ <a href="{$attachmentBrokerQuery}"><xsl:value-of select="@name" /></a>
+ </xsl:when>
+ <xsl:when test="@contentDisposition = 'link'">
+ <xsl:variable name="attachmentUri"><xsl:call-template name="path-to-uri"><xsl:with-param name="path" select="@contentPath" /></xsl:call-template></xsl:variable>
+ <a href="{$attachmentUri}"><xsl:value-of select="@name" /></a>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="@name" /> (n/a)
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--
+ <xsl:template name="icon">
+ <xsl:param name="kind" />
+
+ <img>
+ <xsl:choose>
+ <xsl:when test="$kind = 'Fixture'">
+ <xsl:attribute name="src">{$imgDir}Fixture.png</xsl:attribute>
+ <xsl:attribute name="alt">Fixture Icon</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$kind = 'Test'">
+ <xsl:attribute name="src">{$imgDir}Test.png</xsl:attribute>
+ <xsl:attribute name="alt">Test Icon</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="src">{$imgDir}Container.png</xsl:attribute>
+ <xsl:attribute name="alt">Container Icon</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </img>
+ </xsl:template>
+ -->
+
+ <!-- Outcome bar -->
+ <xsl:template name="outcomeBar">
+ <xsl:param name="status" />
+
+ <table class="outcomeBar">
+ <tr>
+ <td>
+ <div class="outcomeBar outcome-{$status}">
+ <xsl:text> </xsl:text>
+ </div>
+ </td>
+ </tr>
+ </table>
+ </xsl:template>
+
+ <!-- Progress bar -->
+ <xsl:template name="progressBar">
+ <xsl:param name="passed" select="0"/>
+ <xsl:param name="failed" select="0"/>
+ <xsl:param name="inconclusive" select="0"/>
+ <xsl:param name="skipped" select="0"/>
+
+ <xsl:variable name="total" select="$passed + $failed + $inconclusive + $skipped" />
+
+ <table class="progressBar">
+ <tr>
+ <td>
+ <div class="progressBar">
+ <xsl:choose>
+ <xsl:when test="$use-proportional-progress-bars">
+ <xsl:if test="$passed > 0">
+ <div class="progress-passed" style="width:{100.0 * $passed div $total}%" />
+ </xsl:if>
+ <xsl:if test="$failed > 0">
+ <div class="progress-failed" style="width:{100.0 * $failed div $total}%" />
+ </xsl:if>
+ <xsl:if test="$inconclusive > 0">
+ <div class="progress-inconclusive" style="width:{100.0 * $inconclusive div $total}%" />
+ </xsl:if>
+ <xsl:if test="$skipped > 0">
+ <div class="progress-skipped" style="width:{100.0 * $skipped div $total}%" />
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="$failed > 0"><div class="progress-failed" style="width:100%" /></xsl:when>
+ <xsl:when test="$inconclusive > 0"><div class="progress-inconclusive" style="width:100%" /></xsl:when>
+ <xsl:when test="$passed > 0"><div class="progress-passed" style="width:100%" /></xsl:when>
+ <xsl:otherwise><div class="progress-skipped" style="width:100%" /></xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </div>
+ </td>
+ </tr>
+ </table>
+ </xsl:template>
+
+ <!-- Toggle buttons -->
+ <xsl:template name="toggle">
+ <xsl:param name="href" />
+
+ <img src="{$imgDir}Minus.gif" class="toggle" id="toggle-{$href}" onclick="toggle('{$href}');" alt="Toggle Button" />
+ </xsl:template>
+
+ <xsl:template name="toggle-stop">
+ <img src="{$imgDir}FullStop.gif" alt="Toggle Placeholder" />
+ </xsl:template>
+
+ <!-- Displays visual statistics using a progress bar and outcome icons -->
+ <xsl:template name="visual-statistics">
+ <xsl:param name="statistics"/>
+
+ <xsl:call-template name="progressBar">
+ <xsl:with-param name="passed">
+ <xsl:value-of select="$statistics/@passedCount" />
+ </xsl:with-param>
+ <xsl:with-param name="failed">
+ <xsl:value-of select="$statistics/@failedCount" />
+ </xsl:with-param>
+ <xsl:with-param name="inconclusive">
+ <xsl:value-of select="$statistics/@inconclusiveCount" />
+ </xsl:with-param>
+ <xsl:with-param name="skipped">
+ <xsl:value-of select="$statistics/@skippedCount" />
+ </xsl:with-param>
+ </xsl:call-template>
+
+ <span class="outcome-icons">
+ <img src="{$imgDir}Passed.gif" />
+ <xsl:value-of select="$statistics/@passedCount" />
+ <img src="{$imgDir}Failed.gif" />
+ <xsl:value-of select="$statistics/@failedCount" />
+ <img src="{$imgDir}Ignored.gif" />
+ <xsl:value-of select="$statistics/@inconclusiveCount + $statistics/@skippedCount" />
+ </span>
+ </xsl:template>
+
+ <!-- Include the common report template -->
+ <xsl:include href="Gallio-Report.common.xsl" />
+</xsl:stylesheet>
diff --git a/build/tools/gallio/Reports/xsl/Gallio-Report.html.xsl b/build/tools/gallio/Reports/xsl/Gallio-Report.html.xsl new file mode 100644 index 0000000..9525979 --- /dev/null +++ b/build/tools/gallio/Reports/xsl/Gallio-Report.html.xsl @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:g="http://www.gallio.org/"> + <xsl:output method="html" doctype-system="http://www.w3.org/TR/html4/strict.dtd" + doctype-public="-//W3C//DTD HTML 4.01//EN" indent="yes" encoding="utf-8" omit-xml-declaration="yes" /> + <xsl:param name="resourceRoot" select="''" /> + + <xsl:variable name="cssDir"><xsl:if test="$resourceRoot != ''"><xsl:value-of select="$resourceRoot"/>/</xsl:if>css/</xsl:variable> + <xsl:variable name="jsDir"><xsl:if test="$resourceRoot != ''"><xsl:value-of select="$resourceRoot"/>/</xsl:if>js/</xsl:variable> + <xsl:variable name="imgDir"><xsl:if test="$resourceRoot != ''"><xsl:value-of select="$resourceRoot"/>/</xsl:if>img/</xsl:variable> + <xsl:variable name="attachmentBrokerUrl"></xsl:variable> + + <xsl:template match="/"> + <xsl:apply-templates select="/g:report" mode="html-document" /> + </xsl:template> + + <!-- Include the base HTML / XHTML report template --> + <xsl:include href="Gallio-Report.html+xhtml.xsl" /> +</xsl:stylesheet> diff --git a/build/tools/gallio/Reports/xsl/Gallio-Report.txt.xsl b/build/tools/gallio/Reports/xsl/Gallio-Report.txt.xsl new file mode 100644 index 0000000..9d2fa56 --- /dev/null +++ b/build/tools/gallio/Reports/xsl/Gallio-Report.txt.xsl @@ -0,0 +1,153 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:g="http://www.gallio.org/">
+ <xsl:param name="resourceRoot" select="''" />
+
+ <xsl:param name="show-passed-tests">true</xsl:param>
+ <xsl:param name="show-failed-tests">true</xsl:param>
+ <xsl:param name="show-inconclusive-tests">true</xsl:param>
+ <xsl:param name="show-skipped-tests">true</xsl:param>
+
+ <xsl:output method="text" encoding="utf-8"/>
+
+ <xsl:template match="/">
+ <xsl:apply-templates select="//g:report" />
+ </xsl:template>
+
+ <xsl:template match="g:report">
+ <xsl:apply-templates select="." mode="results"/>
+ <xsl:apply-templates select="g:packageRun/g:statistics" />
+ </xsl:template>
+
+ <xsl:template match="g:statistics">
+ <xsl:text>* Results: </xsl:text>
+ <xsl:call-template name="format-statistics">
+ <xsl:with-param name="statistics" select="." />
+ </xsl:call-template>
+ <xsl:text>
</xsl:text>
+ </xsl:template>
+
+ <xsl:template match="g:report" mode="results">
+ <xsl:variable name="testCases" select="g:packageRun/g:testStepRun/descendant-or-self::g:testStepRun[g:testStep/@isTestCase='true']" />
+
+ <xsl:variable name="passed" select="$testCases[g:result/g:outcome/@status='passed']" />
+ <xsl:variable name="failed" select="$testCases[g:result/g:outcome/@status='failed']" />
+ <xsl:variable name="inconclusive" select="$testCases[g:result/g:outcome/@status='inconclusive']" />
+ <xsl:variable name="skipped" select="$testCases[g:result/g:outcome/@status='skipped']" />
+
+ <xsl:if test="$show-passed-tests and $passed">
+ <xsl:text>* Passed:

</xsl:text>
+ <xsl:apply-templates select="$passed" />
+ <xsl:text>
</xsl:text>
+ </xsl:if>
+
+ <xsl:if test="$show-failed-tests and $failed">
+ <xsl:text>* Failed:

</xsl:text>
+ <xsl:apply-templates select="$failed" />
+ <xsl:text>
</xsl:text>
+ </xsl:if>
+
+ <xsl:if test="$show-inconclusive-tests and $inconclusive">
+ <xsl:text>* Inconclusive:

</xsl:text>
+ <xsl:apply-templates select="$inconclusive" />
+ <xsl:text>
</xsl:text>
+ </xsl:if>
+
+ <xsl:if test="$show-skipped-tests and $skipped">
+ <xsl:text>* Skipped:

</xsl:text>
+ <xsl:apply-templates select="$skipped" />
+ <xsl:text>
</xsl:text>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="g:testStepRun">
+ <xsl:variable name="testId" select="g:testStep/@testId" />
+ <xsl:variable name="test" select="//g:test[@id=$testId]" />
+
+ <xsl:text>[</xsl:text>
+ <xsl:value-of select="$test/g:metadata/g:entry[@key='TestKind']/g:value" />
+ <xsl:text>] </xsl:text>
+ <xsl:value-of select="g:testStep/@fullName" />
+ <xsl:text>
</xsl:text>
+ <xsl:apply-templates select="g:executionLog" />
+ <xsl:text>
</xsl:text>
+
+ <xsl:apply-templates select="g:children/g:testStepRun" />
+ </xsl:template>
+
+ <xsl:template match="g:executionLog">
+ <xsl:apply-templates select="g:streams" />
+ </xsl:template>
+
+ <xsl:template match="g:streams">
+ <xsl:apply-templates select="g:stream" />
+ </xsl:template>
+
+ <xsl:template match="g:stream">
+ <xsl:param name="prefix" select="' '" />
+
+ <xsl:value-of select="$prefix"/>
+ <xsl:text><Stream: </xsl:text>
+ <xsl:value-of select="@name" />
+ <xsl:text>>
</xsl:text>
+ <xsl:apply-templates select="g:body">
+ <xsl:with-param name="prefix" select="concat($prefix, ' ')" />
+ </xsl:apply-templates>
+ <xsl:value-of select="$prefix"/>
+ <xsl:text><End Stream>
</xsl:text>
+ </xsl:template>
+
+ <xsl:template match="g:body">
+ <xsl:param name="prefix" select="''" />
+
+ <xsl:apply-templates select="g:contents">
+ <xsl:with-param name="prefix" select="$prefix" />
+ </xsl:apply-templates>
+ </xsl:template>
+
+ <xsl:template match="g:contents">
+ <xsl:param name="prefix" select="''" />
+
+ <xsl:apply-templates select="child::node()[self::g:text or self::g:section or self::g:embed]">
+ <xsl:with-param name="prefix" select="$prefix" />
+ </xsl:apply-templates>
+ </xsl:template>
+
+ <xsl:template match="g:text">
+ <xsl:param name="prefix" select="''" />
+
+ <xsl:call-template name="indent">
+ <xsl:with-param name="str" select="text()" />
+ <xsl:with-param name="prefix" select="$prefix" />
+ </xsl:call-template>
+ </xsl:template>
+
+ <xsl:template match="g:section">
+ <xsl:param name="prefix" select="''" />
+
+ <xsl:value-of select="$prefix"/>
+ <xsl:text><Section: </xsl:text>
+ <xsl:value-of select="@name" />
+ <xsl:text>>
</xsl:text>
+ <xsl:apply-templates select="g:contents">
+ <xsl:with-param name="prefix" select="concat($prefix, ' ')" />
+ </xsl:apply-templates>
+ <xsl:value-of select="$prefix"/>
+ <xsl:text><End Section>
</xsl:text>
+ </xsl:template>
+
+ <xsl:template match="g:embed">
+ <xsl:param name="prefix" select="''" />
+
+ <xsl:value-of select="$prefix"/>
+ <xsl:text><Attachment: </xsl:text>
+ <xsl:value-of select="@attachmentName"/>
+ <xsl:text>>
</xsl:text>
+ </xsl:template>
+
+ <xsl:template match="*">
+ </xsl:template>
+
+ <!-- Include the common report template -->
+ <xsl:include href="Gallio-Report.common.xsl" />
+</xsl:stylesheet>
\ No newline at end of file diff --git a/build/tools/gallio/Reports/xsl/Gallio-Report.xhtml.xsl b/build/tools/gallio/Reports/xsl/Gallio-Report.xhtml.xsl new file mode 100644 index 0000000..3ee90b1 --- /dev/null +++ b/build/tools/gallio/Reports/xsl/Gallio-Report.xhtml.xsl @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:g="http://www.gallio.org/" + xmlns="http://www.w3.org/1999/xhtml"> + <xsl:output method="xml" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" + doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" indent="yes" encoding="utf-8" /> + <xsl:param name="resourceRoot" select="''" /> + + <xsl:variable name="cssDir"><xsl:if test="$resourceRoot != ''"><xsl:value-of select="$resourceRoot"/>/</xsl:if>css/</xsl:variable> + <xsl:variable name="jsDir"><xsl:if test="$resourceRoot != ''"><xsl:value-of select="$resourceRoot"/>/</xsl:if>js/</xsl:variable> + <xsl:variable name="imgDir"><xsl:if test="$resourceRoot != ''"><xsl:value-of select="$resourceRoot"/>/</xsl:if>img/</xsl:variable> + <xsl:variable name="attachmentBrokerUrl"></xsl:variable> + + <xsl:template match="/"> + <xsl:apply-templates select="/g:report" mode="xhtml-document" /> + </xsl:template> + + <!-- Include the base HTML / XHTML report template --> + <xsl:include href="Gallio-Report.html+xhtml.xsl" /> +</xsl:stylesheet> |
