]> git.saurik.com Git - wxWidgets.git/commitdiff
Try to provide backtraces on unix buildbots if the test program crashes.
authorMichael Wetherell <mike.wetherell@ntlworld.com>
Sun, 18 Apr 2010 17:19:06 +0000 (17:19 +0000)
committerMichael Wetherell <mike.wetherell@ntlworld.com>
Sun, 18 Apr 2010 17:19:06 +0000 (17:19 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64034 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

build/buildbot/config/include/defs.xml

index 5b854d5aee8bd1be251e74c713ef97e6d286fa27..fc251c31229de19710dd51473fbc48d6194c77ab 100644 (file)
 -->
 <xsl:template name="run-tests">
     <xsl:param name="content"/>
 -->
 <xsl:template name="run-tests">
     <xsl:param name="content"/>
-    <xsl:param name="options"/>
+    <xsl:param name="options" select="'-t'"/>
+    <xsl:param name="guioptions" select="$options"/>
     <xsl:param name="msw"><is-msw/></xsl:param>
     <test>
         <defaults content="{$content}">
     <xsl:param name="msw"><is-msw/></xsl:param>
     <test>
         <defaults content="{$content}">
             <command>
                 <xsl:choose>
                     <xsl:when test="$msw = 'true'">
             <command>
                 <xsl:choose>
                     <xsl:when test="$msw = 'true'">
-                        <run-tests-win options="{$options}"/>
+                        <run-tests-win options="{$options}" guioptions="{$guioptions}"/>
                     </xsl:when>
                     <xsl:otherwise>
                     </xsl:when>
                     <xsl:otherwise>
-                        <run-tests-unix options="{$options}"/>
+                        <run-tests-unix options="{$options}" guioptions="{$guioptions}"/>
                     </xsl:otherwise>
                 </xsl:choose>
             </command>
                     </xsl:otherwise>
                 </xsl:choose>
             </command>
 
 <xsl:template name="run-tests-win">
     <xsl:param name="options"/>
 
 <xsl:template name="run-tests-win">
     <xsl:param name="options"/>
+    <xsl:param name="guioptions"/>
 <normalize-space>
 cd tests &amp;&amp; runtests.bat
 </normalize-space>
 <normalize-space>
 cd tests &amp;&amp; runtests.bat
 </normalize-space>
@@ -367,10 +369,31 @@ cd tests &amp;&amp; runtests.bat
 
 <xsl:template name="run-tests-unix">
     <xsl:param name="options"/>
 
 <xsl:template name="run-tests-unix">
     <xsl:param name="options"/>
+    <xsl:param name="guioptions"/>
 ERR=0
 cd tests || exit 0
 ERR=0
 cd tests || exit 0
-./test <xsl:value-of select="normalize-space($options)"/> || ERR=$?
-if [ -n "$DISPLAY" -a -x test_gui ]; then ./test_gui || ERR=$?; fi
+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)"/>
+
+if [ -n "$DISPLAY" -a -x test_gui ]; then
+    try ./test_gui <xsl:value-of select="normalize-space($guioptions)"/>
+fi
+
 exit $ERR
 </xsl:template>
 
 exit $ERR
 </xsl:template>