2009-10-09 06:06:59 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
2009-10-17 07:16:25 +08:00
|
|
|
check_schema () {
|
2009-10-09 06:06:59 +08:00
|
|
|
|
|
|
|
DIRS=$1
|
2009-12-01 03:01:31 +08:00
|
|
|
SCHEMA="$abs_srcdir/../docs/schemas/$2"
|
|
|
|
|
|
|
|
test_intro $this_test
|
2009-10-09 06:06:59 +08:00
|
|
|
|
|
|
|
n=0
|
|
|
|
f=0
|
|
|
|
for dir in $DIRS
|
|
|
|
do
|
|
|
|
XML=`find $abs_srcdir/$dir -name '*.xml'` || exit 1
|
|
|
|
|
|
|
|
for xml in $XML
|
|
|
|
do
|
|
|
|
n=`expr $n + 1`
|
|
|
|
cmd="xmllint --relaxng $SCHEMA --noout $xml"
|
|
|
|
result=`$cmd 2>&1`
|
|
|
|
ret=$?
|
2009-12-01 03:01:31 +08:00
|
|
|
|
|
|
|
test_result $n $(basename $(dirname $xml))"/"$(basename $xml) $ret
|
|
|
|
if test "$verbose" = "1" -a $ret != 0 ; then
|
2009-10-09 06:06:59 +08:00
|
|
|
echo -e "$cmd\n$result"
|
2009-12-01 03:01:31 +08:00
|
|
|
fi
|
|
|
|
if test "$ret" != 0 ; then
|
2009-10-09 06:06:59 +08:00
|
|
|
f=`expr $f + 1`
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
done
|
2009-12-01 03:01:31 +08:00
|
|
|
|
|
|
|
test_final $n $f
|
2009-10-09 06:06:59 +08:00
|
|
|
|
|
|
|
ret=0
|
|
|
|
test $f != 0 && ret=255
|
|
|
|
exit $ret
|
|
|
|
|
|
|
|
}
|