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