1 <?xml version=
"1.0" encoding=
"utf-8"?>
4 Name: include/testdrive-unix.xml
5 Purpose: Declarations for the testdrive unix build slave
8 Copyright: (c) 2007 Mike Wetherell
9 Licence: wxWidgets licence
12 <bot xmlns:
xi=
"http://www.w3.org/2001/XInclude"
13 xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform"
16 <xi:include href=
"testdrive.xml"/>
19 post-checkout - post checkout <command> run by <checkout>
21 Usage: <post-checkout/>
23 The command is executed inside the shared checkout dir, and normally it
24 is used to make a private copy.
26 <xsl:template name=
"post-checkout">
31 cp -pR . $BUILDDIR || { cd; rm -rf $BUILDDIR; exit
1; }
36 unarchive - post fetch <command> run by <fetch>
40 The command is executed in the $HOME directory on the remote machine,
41 it is used to extract the fetched archive to the build directory.
43 <xsl:template name=
"unarchive">
48 SOURCE=`echo $SOURCE | sed "s|^[^/]|$HOME/
&|"`
52 gunzip -c $SOURCE | tar xf -
55 bunzip2 -c $SOURCE | tar xf -
66 configure - make disable-precomp-headers a default configure option for
67 the testdrive, and post process the Makefiles to use ccache.
69 Usage: <configure options="-with-foobar"/>
71 <xsl:template name=
"configure">
72 <xsl:param name=
"content"/>
73 <xsl:param name=
"options"/>
75 <copy-with-defaults content=
"{$content}">
76 <command>./configure --disable-precomp-headers
<xsl:value-of select=
"normalize-space($options)"/></command>
78 <command>find . -name Makefile | xargs perl -pi -e 's/^(?:CC|CXX) = /$
&ccache /'
</command>
83 setup - a build step that makes sure any prerequisites are set up for
84 the current testdrive build.
87 <setup cppunit-options="-host=i686-apple-darwin8"/>
89 One of the things it sets up is cppunit. There is more than one compiler
90 available on some of the testdrive machines, and generally speaking
91 cppuint needs to be compiled by the same one that will be used for the
94 <xsl:template name=
"setup">
95 <xsl:param name=
"content"/>
96 <xsl:param name=
"options"/>
97 <xsl:param name=
"ccache-configure" select=
"'./configure INSTALL=./install-sh\ -c --prefix=$HOME --bindir=$OPTDIR/bin'"/>
98 <xsl:param name=
"ccache-options"/>
99 <xsl:param name=
"cppunit-configure" select=
"'./configure INSTALL=config/install-sh\ -c --prefix=$HOME --bindir=$OPTDIR/bin --libdir=$OPTDIR/lib --disable-static'"/>
100 <xsl:param name=
"cppunit-options"/>
102 <description>setting up
</description>
103 <descriptionDone>set up
</descriptionDone>
107 DSPACE=`df -Pk $BUILDDIR | tail -
1 | awk '{ print $
4 }'`
108 if [ $DSPACE -lt $MINSPACE ]; then
109 echo "Disk space low, skipping build"
112 if [ -z "$CCACHE_DIR" ]; then
113 gunzip -c $HOME/src/ccache-*.tar.gz | tar xf -
115 <xsl:value-of select=
"concat($ccache-configure, ' ', $ccache-options, ' ', $options)"/>
122 if { cppunit-config --version || "$CPPUNIT_CONFIG" --version; }
2>/dev/null; then
125 if [ -z "$HAVE_CPPUNIT" ]; then
126 gunzip -c $HOME/src/cppunit-*.tar.gz | tar xf -
128 <xsl:value-of select=
"concat($cppunit-configure, ' ', $cppunit-options, ' ', $options)"/>
130 chmod +x $OPTDIR/bin/cppunit-config
139 profile - see <steps>.
141 <xsl:template name=
"profile">
147 TOPDIR=
<get-builddir/>
148 BUILDDIR=$TOPDIR/build
149 OPTDIR=$HOME/opt/
<basename><get name=
"builddir"/></basename>
154 prologue - see <steps>.
156 <xsl:template name=
"prologue">
158 INSTALLDIR=$TOPDIR/install
160 Linux*
86*) PATH=$HOME/linux-x86/bin:$PATH ;;
162 PATH=$OPTDIR/bin:$PATH
163 LD_LIBRARY_PATH=$BUILDDIR/lib:$OPTDIR/lib:$LD_LIBRARY_PATH
164 export LD_LIBRARY_PATH
165 if { ccache -V; }
>/dev/null
2>&1; then
166 CCACHE_DIR=$TOPDIR/ccache
171 if [ -f wx-config ]; then
172 `./wx-config --cxx` --version
174 <if-del-on-fail>trap 'cd; rm -rf $BUILDDIR' EXIT
</if-del-on-fail>
179 epilogue - see <steps>.
181 <xsl:template name=
"epilogue">
182 <xsl:if test=
"position() != last()">
184 <command>trap '' EXIT
</command>
190 builddir - override <builddir> to accept a full path
192 Usage: <builddir>/tmp/wx/foobar</builddir>
194 Normally builddir is a single directory name not a full path. Override
195 to allow a working directory to be selected on the remote testdrive
198 The actual builddir (i.e. last part 'foobar') as usual must be unique
199 across all the builds of all the slaves.
201 <xsl:template name=
"builddir">
202 <xsl:param name=
"content"/>
204 <basename><xsl:copy-of select=
"$content"/></basename>
209 Put builds under /tmp/wx on the remote machines by default.
211 If the <builddir> element specifies a full path then returns that
212 as-is, otherwise prepends '/tmp/wx/'.
214 <xsl:template name=
"get-builddir">
215 <xsl:variable name=
"builddir"><get name=
"builddir"/></xsl:variable>
216 <xsl:if test=
"substring($builddir, 1, 1) != '/'">
217 <xsl:text>/tmp/wx/
</xsl:text>
219 <xsl:value-of select=
"$builddir"/>
223 basename - returns the final component of a path
225 Usage: <basename>/foo/bar</basename>
229 <xsl:template name=
"basename">
230 <xsl:param name=
"path"/>
232 <xsl:when test=
"contains($path, '/')">
233 <xsl:call-template name=
"basename">
234 <xsl:with-param name=
"path" select=
"substring-after($path, '/')"/>
238 <xsl:value-of select=
"$path"/>