summaryrefslogtreecommitdiff
path: root/tests/schematestutils.sh
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2009-11-30 19:01:31 +0000
committerDaniel P. Berrange <berrange@redhat.com>2010-01-15 16:28:05 +0000
commite8ac4a79f17b741e46980d1db8ca8815b060d39e (patch)
treeb01b037087ac7a3ee20202bff88222057b9c4417 /tests/schematestutils.sh
parentcfe49446d3d2b181db69330a01a609bf84490072 (diff)
downloadlibvirt-e8ac4a79f17b741e46980d1db8ca8815b060d39e.tar.gz
Make test suite output less verbose
Only print out '.' for each test case, full test output can be re-enabled with VIR_TEST_VERBOSE=1, or VIR_TEST_DEBUG=XXXX Sample output now looks like TEST: statstest ........................................ 40 ................................... 75 OK PASS: statstest TEST: qparamtest ................................ 32 OK PASS: qparamtest TEST: ............ 12 OK
Diffstat (limited to 'tests/schematestutils.sh')
-rw-r--r--tests/schematestutils.sh20
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/schematestutils.sh b/tests/schematestutils.sh
index 56e6d83cfc..301b9ebc64 100644
--- a/tests/schematestutils.sh
+++ b/tests/schematestutils.sh
@@ -1,12 +1,11 @@
#!/bin/sh
-test -z "$srcdir" && srcdir=`pwd`
-test -z "$abs_srcdir" && abs_srcdir=`pwd`
-
check_schema () {
DIRS=$1
-SCHEMA="$srcdir/../docs/schemas/$2"
+SCHEMA="$abs_srcdir/../docs/schemas/$2"
+
+test_intro $this_test
n=0
f=0
@@ -17,20 +16,21 @@ do
for xml in $XML
do
n=`expr $n + 1`
- printf "%4d) %.60s " $n $(basename $(dirname $xml))"/"$(basename $xml)
cmd="xmllint --relaxng $SCHEMA --noout $xml"
result=`$cmd 2>&1`
ret=$?
- if test $ret = 0; then
- echo "OK"
- else
- echo "FAILED"
+
+ test_result $n $(basename $(dirname $xml))"/"$(basename $xml) $ret
+ if test "$verbose" = "1" -a $ret != 0 ; then
echo -e "$cmd\n$result"
+ fi
+ if test "$ret" != 0 ; then
f=`expr $f + 1`
fi
done
done
-echo "Validated $n files, $f failed"
+
+test_final $n $f
ret=0
test $f != 0 && ret=255