• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" encoding="utf-8"?>
2<!--
3   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
4
5   Distributed under the Boost Software License, Version 1.0.
6   (See accompanying file LICENSE_1_0.txt or copy at
7   http://www.boost.org/LICENSE_1_0.txt)
8  -->
9<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
10                version="1.0">
11  <xsl:template match="testsuite">
12    <section>
13      <xsl:choose>
14        <xsl:when test="@id">
15          <xsl:attribute name="id">
16            <xsl:value-of select="@id"/>
17          </xsl:attribute>
18        </xsl:when>
19        <xsl:when test="../@id">
20          <xsl:attribute name="id">
21            <xsl:value-of select="concat(../@id, '.tests')"/>
22          </xsl:attribute>
23        </xsl:when>
24      </xsl:choose>
25
26      <title>Testsuite</title>
27
28      <xsl:if test="compile-test|link-test|run-test">
29        <section>
30          <xsl:if test="@id">
31            <xsl:attribute name="id">
32              <xsl:value-of select="@id"/>
33              <xsl:text>.acceptance</xsl:text>
34            </xsl:attribute>
35          </xsl:if>
36
37          <title>Acceptance tests</title>
38          <informaltable>
39            <tgroup cols="3">
40              <colspec colnum="2" colwidth="1in"/>
41              <thead>
42                <row>
43                  <entry>Test</entry>
44                  <entry>Type</entry>
45                  <entry>Description</entry>
46                  <entry>If failing...</entry>
47                </row>
48              </thead>
49              <tbody>
50                <xsl:apply-templates select="compile-test|link-test|run-test"/>
51              </tbody>
52            </tgroup>
53          </informaltable>
54        </section>
55      </xsl:if>
56
57      <xsl:if test="compile-fail-test|link-fail-test|run-fail-test">
58        <section>
59          <xsl:if test="@id">
60            <xsl:attribute name="id">
61              <xsl:value-of select="@id"/>
62              <xsl:text>.negative</xsl:text>
63            </xsl:attribute>
64          </xsl:if>
65          <title>Negative tests</title>
66          <informaltable>
67            <tgroup cols="3">
68              <colspec colnum="2" colwidth="1in"/>
69              <thead>
70                <row>
71                  <entry>Test</entry>
72                  <entry>Type</entry>
73                  <entry>Description</entry>
74                  <entry>If failing...</entry>
75                </row>
76              </thead>
77              <tbody>
78                <xsl:apply-templates
79                  select="compile-fail-test|link-fail-test|run-fail-test"/>
80              </tbody>
81            </tgroup>
82          </informaltable>
83        </section>
84      </xsl:if>
85    </section>
86  </xsl:template>
87
88  <xsl:template match="compile-test|link-test|run-test|
89                       compile-fail-test|link-fail-test|run-fail-test">
90    <row>
91      <entry>
92        <simpara>
93          <ulink>
94            <xsl:attribute name="url">
95              <xsl:value-of
96                select="concat('../../libs/',
97                               ancestor::library/attribute::dirname, '/test/',
98                               @filename)"/>
99            </xsl:attribute>
100            <xsl:value-of select="@filename"/>
101          </ulink>
102        </simpara>
103      </entry>
104      <entry>
105        <simpara>
106          <xsl:value-of select="substring-before(local-name(.), '-test')"/>
107        </simpara>
108      </entry>
109      <entry><xsl:apply-templates select="purpose/*"/></entry>
110      <entry><xsl:apply-templates select="if-fails/*"/></entry>
111    </row>
112  </xsl:template>
113
114  <xsl:template match="snippet">
115    <xsl:variable name="snippet-name" select="@name"/>
116    <xsl:apply-templates select="//programlisting[@name=$snippet-name]"/>
117  </xsl:template>
118</xsl:stylesheet>
119