From e8ac4a79f17b741e46980d1db8ca8815b060d39e Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Mon, 30 Nov 2009 19:01:31 +0000 Subject: 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 --- tests/schematestutils.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'tests/schematestutils.sh') 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 -- cgit v1.2.1