summaryrefslogtreecommitdiffstats
path: root/run
diff options
context:
space:
mode:
Diffstat (limited to 'run')
-rwxr-xr-xrun22
1 files changed, 21 insertions, 1 deletions
diff --git a/run b/run
index ae97a5b..f4d8444 100755
--- a/run
+++ b/run
@@ -6,11 +6,15 @@ export dtf_resultdir=${dtf_resultdir_override-/var/tmp/dtf}
export dtf_srcdir=$(dirname $(readlink -f ${BASH_SOURCE[0]}))
export dtf_testdir=${dtf_testdir-$dtf_srcdir}
+export dtf_resultxml_file=/var/tmp/dtf.xml
+
export dtf_option_verbose=0
export dtf_option_force=0
export dtf_option_testids=""
export dtf_option_listonly=0
+. $dtf_srcdir/lib.sh
+
## F.DEFS ##
info()
@@ -32,6 +36,15 @@ run()
export dtf_workdir=$1
export dtf_test_id=`basename $dtf_workdir`
+ dtf_resultxml_cache "$( cd $dtf_workdir
+ . ./config.sh
+ echo "<test>"
+ echo "<id>$DTF_TEST_ID</id>"
+ echo "<description>"
+ echo "$DTF_TEST_DESCRIPTION"
+ echo "</description>"
+ )"
+
( cd $dtf_workdir
outlog="$dtf_resultdir/$dtf_test_id.log"
@@ -41,7 +54,8 @@ run()
&& output_wrapper="tee $outlog"
test ! -e ./config.sh -o ! -e ./config.sh \
- && echo "can not find one of {config,runtest}.sh"
+ && echo "can not find one of {config,runtest}.sh" \
+ && exit 1
. ./config.sh
@@ -142,10 +156,16 @@ done
test $dtf_option_listonly -ne 1 && prepare_resultdir
+dtf_resultxml_init "$dtf_resultxml_file"
result=0
for i in `find $dtf_testdir -name runtest.sh`; do
testdir=`dirname $i`
run $testdir || result=1
+
+ test $result -eq 0 \
+ && dtf_resultxml_cache "<result>Success</result></test>" \
+ || dtf_resultxml_cache "<result>Fail</result></test>"
done
+dtf_resultxml_finish
exit $result