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)
85 # discard references to launchapd bugs
87 DISCARD_PATTERN
='Please fix https://bugs.launchpad.net/ubuntu/+source/gtk-doc/+bug/[0-9]* . For now run:
91 for file in $dir/*/docs
/gtkdoc-
*.log
; do
93 # adjust for known files
94 if test $file = "$dir/fail/docs/gtkdoc-mkdb.log"; then
97 if test $file = "$dir/bugs/docs/gtkdoc-mkdb.log"; then
100 if test $file = "$dir/gobject/docs/gtkdoc-fixxref.log"; then
105 # if there is no /usr/share/gtk-doc/html/gobject we should skip fixxref logs
106 if test ! -d "$GLIB_PREFIX/share/gtk-doc/html/gobject"; then
112 lines
=`grep -v -x -G -e "$DISCARD_PATTERN" $file | wc -l | cut -d' ' -f1`
113 if test $lines -gt $expected_lines; then
114 echo 1>&2 "expected no more than $expected_lines log line in $file, but got $lines"
118 if test $nok -gt 0 ; then failed
=`expr $failed + 1`; fi
119 tested
=`expr $tested + 1`
121 # check stability of generated xml/html
123 for path
in $dir/*/docs
*; do
124 if test -d $path/xml.ref
; then
125 diff -u $path/xml.ref
$path/xml
126 if test $?
= 1 ; then
127 echo 1>&2 "difference in generated xml for $path"
131 if test -d $path/html.ref
; then
132 diff -u $path/html.ref
$path/html
133 if test $?
= 1 ; then
134 echo 1>&2 "difference in generated html for $path"
139 if test $nok -gt 0 ; then failed
=`expr $failed + 1`; fi
140 tested
=`expr $tested + 1`
144 successes
=`expr $tested - $failed`
145 rate
=`expr 100 \* $successes / $tested`;
146 echo "$rate %: Checks $tested, Failures: $failed"