10 echo "Running suite(s): gtk-doc-$suite";
12 # check the presence and non-emptyness of certain files
14 for path
in $dir/*/docs
/html
; do
15 if test ! -s $path/index.html
; then
16 echo 1>&2 "no or empty $path/index.html"
17 nok
=`expr $nok + 1`; break;
19 if test ! -s $path/home.png
; then
20 echo 1>&2 "no or empty $path/home.png"
21 nok
=`expr $nok + 1`; break;
23 file=`echo $path/*.devhelp2`
24 if test ! -s $file ; then
25 echo 1>&2 "no or empty $file"
26 nok
=`expr $nok + 1`; break;
29 if test $nok -gt 0 ; then failed
=`expr $failed + 1`; fi
30 tested
=`expr $tested + 1`
32 # TODO: if we have pdf support check for ./tests/*/docs/tester.pdf
34 for path
in $dir/*/docs
; do
35 if test ! -s $path/tester.pdf
; then
36 if test -s $path/gtkdoc-mkpdf.log
; then
37 if ! grep >/dev
/null
2>&1 "must be installed to use gtkdoc-mkpdf" $path/gtkdoc-mkpdf.log
; then
38 echo 1>&2 "no or empty $path/tester.pdf"
39 nok
=`expr $nok + 1`; break;
44 if test $nok -gt 0 ; then failed
=`expr $failed + 1`; fi
45 tested
=`expr $tested + 1`
47 # check validity of generated xml files
49 for file in $dir/*/docs
/xml
/*.xml
; do
50 xmllint
--noout --noent $file
51 if test $?
!= 0 ; then
52 echo 1>&2 "xml validity check failed for $file"
56 if test $nok -gt 0 ; then failed
=`expr $failed + 1`; fi
57 tested
=`expr $tested + 1`
60 # check validity of generated sgml files
62 for file in $dir/*/docs
/xml
/*.sgml
; do
63 xmllint
--noout --noent $file
64 if test $?
!= 0 ; then
65 echo 1>&2 "sgml validity check failed for $file"
69 if test $nok -gt 0 ; then failed
=`expr $failed + 1`; fi
70 tested
=`expr $tested + 1`
72 # check validity of devhelp2 files
74 for file in $dir/*/docs
/html
/*.devhelp2
; do
75 xmllint
--noout --nonet --schema $ABS_TOP_SRCDIR/devhelp2.xsd
$file
76 if test $?
!= 0 ; then
77 echo 1>&2 "devhelp2 xml validity check failed for $file"
81 if test $nok -gt 0 ; then failed
=`expr $failed + 1`; fi
82 tested
=`expr $tested + 1`
84 # check that log files have only one line (the command)
86 for file in $dir/*/docs
/gtkdoc-
*.log
; do
88 # adjust for known files
89 if test $file = "$dir/fail/docs/gtkdoc-mkdb.log"; then
92 if test $file = "$dir/gobject/docs/gtkdoc-fixxref.log"; then
97 # if there is no /usr/share/gtk-doc/html/gobject we should skip fixxref logs
98 if test ! -d "$GLIB_PREFIX/share/gtk-doc/html/gobject"; then
104 lines
=`wc -l $file | cut -d' ' -f1`
105 if test $lines -gt $expected_lines; then
106 echo 1>&2 "expected no more than $expected_lines log line in $file, but got $lines"
110 if test $nok -gt 0 ; then failed
=`expr $failed + 1`; fi
111 tested
=`expr $tested + 1`
113 # check stability of generated xml/html
115 for path
in $dir/*/docs
*; do
116 if test -d $path/xml.ref
; then
117 diff -u $path/xml.ref
$path/xml
118 if test $?
= 1 ; then
119 echo 1>&2 "difference in generated xml for $path"
123 if test -d $path/html.ref
; then
124 diff -u $path/html.ref
$path/html
125 if test $?
= 1 ; then
126 echo 1>&2 "difference in generated html for $path"
131 if test $nok -gt 0 ; then failed
=`expr $failed + 1`; fi
132 tested
=`expr $tested + 1`
136 successes
=`expr $tested - $failed`
137 rate
=`expr 100 \* $successes / $tested`;
138 echo "$rate %: Checks $tested, Failures: $failed"