diff options
author | dac <qt-info@nokia.com> | 2010-06-09 12:00:17 +1000 |
---|---|---|
committer | dac <qt-info@nokia.com> | 2010-06-09 12:00:17 +1000 |
commit | 7fd00ac1deddb755b47458f65f2900fc4772d616 (patch) | |
tree | 06ea504de072a814a44821817d76dae86b2672c9 /scripts |
Initial commit
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/qtestxml2junitxml.xsl | 82 | ||||
-rwxr-xr-x | scripts/storetest | 75 | ||||
-rwxr-xr-x | scripts/storetestresults | bin | 0 -> 121612 bytes |
3 files changed, 157 insertions, 0 deletions
diff --git a/scripts/qtestxml2junitxml.xsl b/scripts/qtestxml2junitxml.xsl new file mode 100644 index 0000000..aab2d0f --- /dev/null +++ b/scripts/qtestxml2junitxml.xsl @@ -0,0 +1,82 @@ +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> + +<xsl:output method="xml" indent="yes" /> +<xsl:decimal-format decimal-separator="." grouping-separator="," /> + +<!-- misc variables --> +<xsl:variable name="classname" select="/TestCase/@name" /> +<xsl:variable name="total-tests" select="count(/TestCase/TestFunction)" /> +<xsl:variable name="total-failures" select="count(/TestCase/TestFunction/Incident[@type='fail'])" /> + +<!-- main template call --> +<xsl:template match="/"> + <xsl:apply-templates select="TestCase"/> +</xsl:template> + +<xsl:template match="TestCase"> + <testsuite name="{$classname}" tests="{$total-tests}" failures="{$total-failures}" errors="0" time="0.0"> + <xsl:apply-templates select="Environment"/> + <xsl:apply-templates select="TestFunction" /> + <xsl:call-template name="display-system-out" /> + <xsl:call-template name="display-system-err" /> + </testsuite> +</xsl:template> + +<xsl:template match="Environment"> + <properties> + <xsl:for-each select="*"> + <property name="{name()}" value="{text()}" /> + </xsl:for-each> + </properties> +</xsl:template> + +<xsl:template match="TestFunction"> + <testcase classname="{$classname}" name="{@name}" time="0.0"> + <!-- handle fail --> + <xsl:if test="Incident/@type = 'fail'"> + <!-- will be used to generate "nice" error message --> + <xsl:variable name="file" select="Incident/@file" /> + <xsl:variable name="line" select="Incident/@line" /> + <xsl:variable name="description"> + <xsl:value-of select="Incident/Description" /> + </xsl:variable> + + <!-- display a reasonable error message --> + <xsl:element name="failure"> + <xsl:attribute name="type">Standard</xsl:attribute> + <xsl:attribute name="message"> + <xsl:value-of select="concat($file,':',$line,' :: ',$description)" /> + </xsl:attribute> + </xsl:element> + + </xsl:if> + + <!-- handle skip --> + <xsl:if test="Incident/@type = 'skip'"> + + </xsl:if> + </testcase> +</xsl:template> + +<xsl:template name="display-system-out"> + <system-out> + <xsl:for-each select="/TestCase/TestFunction/Incident[@type='fail'] | /TestCase/TestFunction/Message[@type='skip']"> + <xsl:choose> + <xsl:when test="@type='fail'"> + <xsl:value-of select="Description"/> + </xsl:when> + <xsl:when test="@type='skip'"> + <xsl:value-of select="Description"/> + </xsl:when> + </xsl:choose> + </xsl:for-each> + </system-out> +</xsl:template> + +<xsl:template name="display-system-err"> + <!-- do nothing for now --> + <system-err /> +</xsl:template> + +</xsl:stylesheet> + diff --git a/scripts/storetest b/scripts/storetest new file mode 100755 index 0000000..8153c07 --- /dev/null +++ b/scripts/storetest @@ -0,0 +1,75 @@ +#!/bin/sh + +STORETESTRESULTS=storetestresults + +if ! command -v $STORETESTRESULTS 2&>1 > /dev/null; then + STORETESTRESULTS=`dirname $0`/$STORETESTRESULTS + if ! [ -e $STORETESTRESULTS ]; then + echo $STORETESTRESULTS not found + exit 1 + fi +fi + +echo -n "Test platform [$QTUITEST_PLATFORM] : " +read TESTPLATFORM +if [ "$TESTPLATFORM" = "" ]; then + TESTPLATFORM=$QTUITEST_PLATFORM +fi +case "$TESTPLATFORM" in *symbian*|*linux*|*maemo*|*windows*|*wince*|*mac*) + ;; +*) + echo Test platform must contain one of symbian, linux, maemo, windows, wince, mac + exit 1 + ;; +esac + +echo -n "Change or build number [$QTUITEST_CHANGE] : " +read TESTCHANGE +if [ "$TESTCHANGE" = "" ]; then + if [ "$QTUITEST_CHANGE" = "" ]; then + echo Change or build number must be specified + exit 1 + fi + TESTCHANGE=$QTUITEST_CHANGE +fi + +echo -n "Branch [$QTUITEST_BRANCH] : " +read TESTBRANCH +if [ "$TESTBRANCH" = "" ]; then + if [ "$QTUITEST_BRANCH" = "" ]; then + echo Branch must be specified + exit 1 + fi + TESTBRANCH=$QTUITEST_BRANCH +fi + +if [ "$QTUITEST_TESTR" = "" ]; then + QTUITEST_TESTR=qt@gitestr.nokia.troll.no:/home/qt/results +fi +echo -n "Upload location [$QTUITEST_TESTR] : " +read TESTTESTR +if [ "$TESTTESTR" = "" ]; then + TESTTESTR=$QTUITEST_TESTR +fi + +TIMESTAMP=`date +%s` +TESTNAME=`basename $BUILDDIR` +RESULTSDIR=/tmp/qtuitest_results_$TIMESTAMP +mkdir $RESULTSDIR +TESTPLATFORM=$TESTPLATFORM PATH=$BUILDDIR:$PATH QTUITEST_INCLUDE_PATH=$SRCROOT/tests/shared:$QTUITEST_INCLUDE_PATH LD_LIBRARY_PATH=$BUILDROOT/libqsystemtest:$BUILDROOT/lib:$LD_LIBRARY_PATH $BUILDROOT/interpreter/qtuitestrunner $* -xml -o $RESULTSDIR/$TESTNAME.xml + +if [ -e $RESULTSDIR/$TESTNAME.xml ]; then + echo Results are in $RESULTSDIR/$TESTNAME.xml +else + echo Results are not in expected location! + exit 1 +fi + +$STORETESTRESULTS -in $RESULTSDIR -number $TIMESTAMP -testr $TESTTESTR -prefix $TESTPLATFORM -testrchange $TESTCHANGE -testrbranch $TESTBRANCH +if [ $? != "0" ]; then + echo FAILED: Please check you have entered the correct details. + echo You can retry sending the results using the scp command above + exit 1 +else + echo OK +fi
\ No newline at end of file diff --git a/scripts/storetestresults b/scripts/storetestresults Binary files differnew file mode 100755 index 0000000..a834431 --- /dev/null +++ b/scripts/storetestresults |