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 configure - make disable-precomp-headers a default configure option for
37 the testdrive, and post process the Makefiles to use ccache.
39 Usage: <configure options="-with-foobar"/>
41 <xsl:template name=
"configure">
42 <xsl:param name=
"content"/>
43 <xsl:param name=
"options"/>
45 <copy-with-defaults content=
"{$content}">
46 <command>./configure --disable-precomp-headers
<xsl:value-of select=
"normalize-space($options)"/></command>
48 <command>find . -name Makefile | xargs perl -pi -e 's/^(?:CC|CXX) = /$
&ccache /'
</command>
53 setup - a build step that makes sure any prerequisites are set up for
54 the current testdrive build.
57 <setup cppunit-options="-host=i686-apple-darwin8"/>
59 One of the things it sets up is cppunit. There is more than one compiler
60 available on some of the testdrive machines, and generally speaking
61 cppuint needs to be compiled by the same one that will be used for the
64 <xsl:template name=
"setup">
65 <xsl:param name=
"content"/>
66 <xsl:param name=
"options"/>
67 <xsl:param name=
"ccache-configure" select=
"'./configure INSTALL=./install-sh\ -c --prefix=$HOME --bindir=$OPTDIR/bin'"/>
68 <xsl:param name=
"ccache-options"/>
69 <xsl:param name=
"cppunit-configure" select=
"'./configure INSTALL=config/install-sh\ -c --prefix=$HOME --bindir=$OPTDIR/bin --libdir=$OPTDIR/lib --disable-static'"/>
70 <xsl:param name=
"cppunit-options"/>
72 <description>setting up
</description>
73 <descriptionDone>set up
</descriptionDone>
77 DSPACE=`df -Pk $BUILDDIR | tail -
1 | awk '{ print $
4 }'`
78 if [ $DSPACE -lt $MINSPACE ]; then
79 echo "Disk space low, skipping build"
82 if [ -z "$CCACHE_DIR" ]; then
83 gunzip -c $HOME/src/ccache-*.tar.gz | tar xf -
85 <xsl:value-of select=
"concat($ccache-configure, ' ', $ccache-options, ' ', $options)"/>
92 if { cppunit-config --version || "$CPPUNIT_CONFIG" --version; }
2>/dev/null; then
95 if [ -z "$HAVE_CPPUNIT" ]; then
96 gunzip -c $HOME/src/cppunit-*.tar.gz | tar xf -
98 <xsl:value-of select=
"concat($cppunit-configure, ' ', $cppunit-options, ' ', $options)"/>
100 chmod +x $OPTDIR/bin/cppunit-config
109 profile - see <steps>.
111 <xsl:template name=
"profile">
117 TOPDIR=
<get-builddir/>
118 BUILDDIR=$TOPDIR/build
119 OPTDIR=$HOME/opt/
<basename><get name=
"builddir"/></basename>
124 prologue - see <steps>.
126 <xsl:template name=
"prologue">
128 INSTALLDIR=$TOPDIR/install
130 Linux*
86*) PATH=$HOME/linux-x86/bin:$PATH ;;
132 PATH=$OPTDIR/bin:$PATH
133 LD_LIBRARY_PATH=$BUILDDIR/lib:$OPTDIR/lib:$LD_LIBRARY_PATH
134 export LD_LIBRARY_PATH
135 if { ccache -V; }
>/dev/null
2>&1; then
136 CCACHE_DIR=$TOPDIR/ccache
141 <if-del-on-fail>trap 'cd; rm -rf $BUILDDIR' EXIT
</if-del-on-fail>
146 epilogue - see <steps>.
148 <xsl:template name=
"epilogue">
149 <xsl:if test=
"position() != last()">
151 <command>trap '' EXIT
</command>
157 builddir - override <builddir> to accept a full path
159 Usage: <builddir>/tmp/wx/foobar</builddir>
161 Normally builddir is a single directory name not a full path. Override
162 to allow a working directory to be selected on the remote testdrive
165 The actual builddir (i.e. last part 'foobar') as usual must be unique
166 across all the builds of all the slaves.
168 <xsl:template name=
"builddir">
169 <xsl:param name=
"content"/>
171 <basename><xsl:copy-of select=
"$content"/></basename>
176 Put builds under /tmp/wx on the remote machines by default.
178 If the <builddir> element specifies a full path then returns that
179 as-is, otherwise prepends '/tmp/wx/'.
181 <xsl:template name=
"get-builddir">
182 <xsl:variable name=
"builddir"><get name=
"builddir"/></xsl:variable>
183 <xsl:if test=
"substring($builddir, 1, 1) != '/'">
184 <xsl:text>/tmp/wx/
</xsl:text>
186 <xsl:value-of select=
"$builddir"/>
190 basename - returns the final component of a path
192 Usage: <basename>/foo/bar</basename>
196 <xsl:template name=
"basename">
197 <xsl:param name=
"path"/>
199 <xsl:when test=
"contains($path, '/')">
200 <xsl:call-template name=
"basename">
201 <xsl:with-param name=
"path" select=
"substring-after($path, '/')"/>
205 <xsl:value-of select=
"$path"/>