Author: Mike Wetherell
RCS-ID: $Id$
Copyright: (c) 2007 Mike Wetherell
- Licence: wxWidgets licence
+ Licence: wxWindows licence
-->
<bot xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
<xsl:template name="SVN_URL">http://svn.wxwidgets.org/svn/wx/wxWidgets/</xsl:template>
<xsl:template name="STABLE_BRANCH">branches/WX_2_8_BRANCH</xsl:template>
<xsl:variable name="STABLE_BRANCH"><STABLE_BRANCH/></xsl:variable>
+<xsl:template name="RELEASE_BRANCH">branches/WX_2_9_0_BRANCH</xsl:template>
+<xsl:variable name="RELEASE_BRANCH"><RELEASE_BRANCH/></xsl:variable>
+<xsl:template name="SNAPSHOT_URL">http://biolpc22.york.ac.uk/pub</xsl:template>
+
+<!--
+ disable - comment out a section.
+
+ Usage: <disable>
+ e.g. <build> ... etc.
+ </disable>
+
+ XML comments can't contain a double hyphen which tends to be used in
+ configure commands, so <disable> can be used instead.
+-->
+<xsl:template name="disable"/>
<!--
checkout - build step for source checkout.
-->
<xsl:template name="run-tests">
<xsl:param name="content"/>
+ <xsl:param name="options" select="'-t'"/>
+ <xsl:param name="guioptions" select="$options"/>
<xsl:param name="msw"><is-msw/></xsl:param>
<test>
<defaults content="{$content}">
<command>
<xsl:choose>
<xsl:when test="$msw = 'true'">
- <run-tests-win/>
+ <run-tests-win options="{$options}" guioptions="{$guioptions}"/>
</xsl:when>
<xsl:otherwise>
- <run-tests-unix/>
+ <run-tests-unix options="{$options}" guioptions="{$guioptions}"/>
</xsl:otherwise>
</xsl:choose>
</command>
</test>
</xsl:template>
-<!--
- We need to add something to the wxWidgets sources to run the tests with a
- simple command so that these aren't necessary.
--->
<xsl:template name="run-tests-win">
+ <xsl:param name="options"/>
+ <xsl:param name="guioptions"/>
<normalize-space>
-cd tests &&
-(for /d %x in (..\lib\*_dll) do @PATH=%x;%PATH%) &&
-(for /d %x in (*) do @if exist %x\test.exe %x\test) &&
-(for /d %x in (*) do @if exist %x\test_gui.exe %x\test_gui)
+cd tests && runtests.bat
</normalize-space>
</xsl:template>
<xsl:template name="run-tests-unix">
-<normalize-space>
-cd tests &&
-./test &&
-if [ -x test_gui ]; then ./test_gui; fi
-</normalize-space>
+ <xsl:param name="options"/>
+ <xsl:param name="guioptions"/>
+ERR=0
+cd tests || exit 0
+ulimit -c unlimited
+
+try()
+{
+ rm -f core
+ echo Running: "$@"
+ "$@" || ERR=$?
+
+ if [ -f core -a -x "`which gdb`" ]; then
+ echo Crashed, attempting to display backtrace:
+ gdb -batch -c core -ex 'set pagination off' -ex bt "$1"
+ fi
+
+ echo
+}
+
+try ./test <xsl:value-of select="normalize-space($options)"/>
+
+test -x test_gui || exit $ERR
+
+if [ -z "$DISPLAY" ]; then
+ echo '$DISPLAY is not set, skipping GUI tests.'
+ exit $ERR
+fi
+
+echo 'Checking window manager:'
+WINDOW_MANAGER=$(xprop -root 32x '\n$0\n' _NET_SUPPORTING_WM_CHECK | grep ^0x)
+
+if [ -z "$WINDOW_MANAGER" ]; then
+ echo 'Window manager not present, skipping GUI tests.'
+ exit $ERR
+fi
+
+xprop -id $WINDOW_MANAGER 8s _NET_WM_NAME
+echo
+
+try ./test_gui <xsl:value-of select="normalize-space($guioptions)"/>
+
+exit $ERR
</xsl:template>
<!--
<xsl:param name="content"/>
<xsl:param name="name"/>
<xsl:choose>
- <xsl:when test="$name = 'sunday'">0</xsl:when>
- <xsl:when test="$name = 'monday'">1</xsl:when>
- <xsl:when test="$name = 'tuesday'">2</xsl:when>
- <xsl:when test="$name = 'wednesday'">3</xsl:when>
- <xsl:when test="$name = 'thursday'">4</xsl:when>
- <xsl:when test="$name = 'friday'">5</xsl:when>
- <xsl:when test="$name = 'saturday'">6</xsl:when>
+ <xsl:when test="$name = 'monday'">0</xsl:when>
+ <xsl:when test="$name = 'tuesday'">1</xsl:when>
+ <xsl:when test="$name = 'wednesday'">2</xsl:when>
+ <xsl:when test="$name = 'thursday'">3</xsl:when>
+ <xsl:when test="$name = 'friday'">4</xsl:when>
+ <xsl:when test="$name = 'saturday'">5</xsl:when>
+ <xsl:when test="$name = 'sunday'">6</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:param name="content"/>
<xsl:param name="number"/>
<xsl:choose>
- <xsl:when test="$number = '0'">sunday</xsl:when>
- <xsl:when test="$number = '1'">monday</xsl:when>
- <xsl:when test="$number = '2'">tuesday</xsl:when>
- <xsl:when test="$number = '3'">wednesday</xsl:when>
- <xsl:when test="$number = '4'">thursday</xsl:when>
- <xsl:when test="$number = '5'">friday</xsl:when>
- <xsl:when test="$number = '6'">saturday</xsl:when>
+ <xsl:when test="$number = '0'">monday</xsl:when>
+ <xsl:when test="$number = '1'">tuesday</xsl:when>
+ <xsl:when test="$number = '2'">wednesday</xsl:when>
+ <xsl:when test="$number = '3'">thursday</xsl:when>
+ <xsl:when test="$number = '4'">friday</xsl:when>
+ <xsl:when test="$number = '5'">saturday</xsl:when>
+ <xsl:when test="$number = '6'">sunday</xsl:when>
</xsl:choose>
</xsl:template>
</xsl:choose>
</xsl:template>
+<!--
+ email - substitute '@' for ' -at- ' in email addresses.
+-->
+<xsl:template name="emailfield">
+ <xsl:param name="content"/>
+ <xsl:param name="addr"/>
+ <xsl:variable name="at"> -at- </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="contains($addr, $at)">
+ <xsl:value-of select="substring-before($addr, $at)"/>
+ <xsl:text>@</xsl:text>
+ <xsl:value-of select="substring-after($addr, $at)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$addr"/>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<xsl:template name="email">
+ <xsl:param name="content"/>
+ <xsl:param name="id"/>
+ <email id="{$id}"><emailfield addr="{$content}"/></email>
+</xsl:template>
+
+<xsl:template name="fromaddr">
+ <xsl:param name="content"/>
+ <fromaddr><emailfield addr="{$content}"/></fromaddr>
+</xsl:template>
+
+<xsl:template name="extraRecipient">
+ <xsl:param name="content"/>
+ <extraRecipient><emailfield addr="{$content}"/></extraRecipient>
+</xsl:template>
+
+<!--
+ mailnotifier - add a default value for <fromaddr> to <mailnotifier>
+-->
+<xsl:template name="mailnotifier">
+ <xsl:param name="content"/>
+ <mailnotifier>
+ <defaults content="{$content}">
+ <fromaddr>noreply -at- wxsite.net</fromaddr>
+ </defaults>
+ <xsl:copy-of select="$content"/>
+ </mailnotifier>
+</xsl:template>
+
</bot>