]> git.saurik.com Git - wxWidgets.git/blob - build/buildbot/config/include/testdrive.xml
New dev.
[wxWidgets.git] / build / buildbot / config / include / testdrive.xml
1 <?xml version="1.0" encoding="utf-8"?>
2
3 <!--
4 Name: include/testdrive.xml
5 Purpose: Declarations for the testdrive build slaves
6 Author: Mike Wetherell
7 RCS-ID: $Id$
8 Copyright: (c) 2007 Mike Wetherell
9 Licence: wxWidgets licence
10 -->
11
12 <bot xmlns:xi="http://www.w3.org/2001/XInclude"
13 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
14 xmlns:exsl="http://exslt.org/common"
15 xmlns:get="local"
16 xsl:version="1.0">
17
18 <xi:include href="defs.xml"/>
19
20 <!--
21 build - add a default <sandbox> element, the same as the previous build.
22 -->
23 <xsl:template name="build">
24 <xsl:param name="content"/>
25 <build>
26 <defaults content="{$content}">
27 <xsl:apply-templates select="get:property('sandbox', get:preceding-builds())[last()]"/>
28 </defaults>
29 <xsl:copy-of select="$content"/>
30 </build>
31 </xsl:template>
32
33 <!--
34 checkout - build step for source checkout.
35
36 Usage: as <svn> with additional <command> element and defaults for
37 <baseURL> and <defaultBranch>
38
39 Typically just:
40 <checkout/>
41 for the trunk, or:
42 <checkout branch="branches/WX_2_8_BRANCH"/>
43 to checkout a branch.
44 -->
45 <xsl:template name="checkout">
46 <xsl:param name="content"/>
47 <xsl:param name="branch" select="'trunk'"/>
48 <xsl:variable name="nodes" select="exsl:node-set($content)"/>
49 <testdrive-svn>
50 <profile/>
51 <xsl:if test="not($nodes/svnurl)">
52 <xsl:if test="not($nodes/baseURL)">
53 <baseURL><SVN_URL/></baseURL>
54 </xsl:if>
55 <xsl:if test="not($nodes/defaultBranch)">
56 <defaultBranch><xsl:value-of select="$branch"/></defaultBranch>
57 </xsl:if>
58 </xsl:if>
59 <xsl:if test="not($nodes/command)">
60 <post-checkout/>
61 </xsl:if>
62 <xsl:copy-of select="$content"/>
63 </testdrive-svn>
64 </xsl:template>
65
66 <!--
67 fatch - fetch an source tarball/zip over http or ftp.
68
69 Usage:
70 <fetch branch="Daily_HEAD/wxX11.tar.gz"/>
71
72 Fetches the URL given by <baseURL>/$branch, where the current default
73 for <baseURL> is "http://biolpc22.york.ac.uk/pub".
74
75 The archive is then extracted by executing <profile/> then <unarchive/>
76 on the remote machine.
77 -->
78 <xsl:template name="fetch">
79 <xsl:param name="content"/>
80 <xsl:param name="branch">Daily_HEAD/wxWidgets.tar.gz</xsl:param>
81 <wget>
82 <profile/>
83 <defaults content="{$content}">
84 <baseURL><SNAPSHOT_URL/></baseURL>
85 <defaultBranch><xsl:value-of select="$branch"/></defaultBranch>
86 <unarchive/>
87 </defaults>
88 <xsl:copy-of select="$content"/>
89 </wget>
90 </xsl:template>
91
92 <!--
93 steps - overrides <steps> to prepend <profile/> and <prologue/> and
94 append <epilogue/> to the <command/> of each build step.
95
96 Usage: as <steps>
97
98 The differences between <profile/> and <prologue/> are:
99 1. <profile/> is also used by <checkout> for its post checkout command.
100 2. In <profile> the current node is the <steps> element.
101 3. In <prologue> the current node is the build step inside a generated
102 nodeset. The current build is passes as a parameter.
103 -->
104 <xsl:template name="steps">
105 <xsl:param name="content"/>
106 <xsl:variable name="profile"><profile/></xsl:variable>
107 <xsl:variable name="build" select="get:build()"/>
108 <steps>
109 <xsl:for-each select="exsl:node-set($content)/*">
110 <xsl:choose>
111 <xsl:when test="contains(name(), 'svn') or
112 contains(name(), 'get')">
113 <xsl:copy-of select="."/>
114 </xsl:when>
115 <xsl:otherwise>
116 <xsl:copy>
117 <xsl:copy-of select="@*"/>
118 <xsl:copy-of select="$profile"/>
119 <prologue build="{$build}"/>
120 <xsl:copy-of select="node()"/>
121 <xsl:if test="not(command)">
122 <command/>
123 </xsl:if>
124 <epilogue build="{$build}"/>
125 </xsl:copy>
126 </xsl:otherwise>
127 </xsl:choose>
128 </xsl:for-each>
129 </steps>
130 </xsl:template>
131
132 <!--
133 if-del-on-fail - used in the context of a build step, copies its content
134 if the build step should cleanup on failure.
135
136 Usage: <if-del-on-fail>foobar</if-del-on-fail>
137
138 On the testdrive the working directory is deleted after a build to save
139 space. If the step has <haltOnFailure/> (which is the default or
140 <configure> and <compile> steps) then this cleanup needs to happen
141 whenever the step fails.
142 -->
143 <xsl:template name="if-del-on-fail">
144 <xsl:param name="content"/>
145 <xsl:if test = "position() = last() or
146 haltOnFailure = '' or
147 haltOnFailure = 'true' or
148 (not(haltOnFailure) and
149 (name() = 'configure' or name() = 'compile'))">
150 <xsl:copy-of select="$content"/>
151 </xsl:if>
152 </xsl:template>
153
154 <!--
155 Add slave locks so that each testdrive machine only runs one bulid at a
156 time.
157 -->
158 <create-locks/>
159
160 <xsl:template name="create-locks">
161 <xsl:variable name="rtf">
162 <xsl:apply-templates select="get:property('sandbox', get:all-builds())"/>
163 </xsl:variable>
164 <xsl:variable name="sandboxes" select="exsl:node-set($rtf)/sandbox"/>
165 <xsl:for-each select="$sandboxes">
166 <xsl:variable name="text" select="text()"/>
167 <xsl:variable name="position" select="position()"/>
168 <xsl:if test="not($sandboxes[text() = $text and position() &lt; $position])">
169 <slavelock>
170 <name><xsl:value-of select="node()"/></name>
171 </slavelock>
172 </xsl:if>
173 </xsl:for-each>
174 </xsl:template>
175
176 <xsl:template name="sandbox">
177 <xsl:param name="content"/>
178 <sandbox><xsl:copy-of select="$content"/></sandbox>
179 <lock><xsl:copy-of select="$content"/></lock>
180 </xsl:template>
181
182 </bot>