9 echo "Running suite(s): gtk-doc-sanity $suite";
11 # check the presence and non-emptyness of certain files
13 for path
in $dir/$suite/docs
/html
; do
14 if test ! -s $path/index.html
; then
15 echo 1>&2 "no or empty $path/index.html"
16 nok
=`expr $nok + 1`; break;
18 if test ! -s $path/home.png
; then
19 echo 1>&2 "no or empty $path/home.png"
20 nok
=`expr $nok + 1`; break;
22 file=`echo $path/*.devhelp2`
23 if test ! -s $file ; then
24 echo 1>&2 "no or empty $file"
25 nok
=`expr $nok + 1`; break;
28 if test $nok -gt 0 ; then failed
=`expr $failed + 1`; fi
29 tested
=`expr $tested + 1`
31 # TODO: if we have pdf support check for ./tests/$suite/docs/tester.pdf
33 for path
in $dir/$suite/docs
; do
34 if test ! -s $path/tester.pdf
; then
35 if test -s $path/gtkdoc-mkpdf.log
; then
36 if ! grep >/dev
/null
2>&1 "must be installed to use gtkdoc-mkpdf" $path/gtkdoc-mkpdf.log
; then
37 echo 1>&2 "no or empty $path/tester.pdf"
38 nok
=`expr $nok + 1`; break;
43 if test $nok -gt 0 ; then failed
=`expr $failed + 1`; fi
44 tested
=`expr $tested + 1`
46 # check validity of generated xml files
48 for file in $dir/$suite/docs
/xml
/*.xml
; do
49 xmllint
--noout --noent $file
50 if test $?
!= 0 ; then
51 echo 1>&2 "xml validity check failed for $file"
55 if test $nok -gt 0 ; then failed
=`expr $failed + 1`; fi
56 tested
=`expr $tested + 1`
59 # check validity of generated sgml files
61 for file in $dir/$suite/docs
/xml
/*.sgml
; do
62 xmllint
--noout --noent $file
63 if test $?
!= 0 ; then
64 echo 1>&2 "sgml validity check failed for $file"
68 if test $nok -gt 0 ; then failed
=`expr $failed + 1`; fi
69 tested
=`expr $tested + 1`
71 # check validity of devhelp2 files
73 for file in $dir/$suite/docs
/html
/*.devhelp2
; do
74 xmllint
--noout --nonet --schema $ABS_TOP_SRCDIR/devhelp2.xsd
$file
75 if test $?
!= 0 ; then
76 echo 1>&2 "devhelp2 xml validity check failed for $file"
80 if test $nok -gt 0 ; then failed
=`expr $failed + 1`; fi
81 tested
=`expr $tested + 1`
83 # check that log files have only one line (the command)
84 # discard references to launchapd bugs
86 DISCARD_PATTERN
='Please fix https://bugs.launchpad.net/ubuntu/+source/gtk-doc/+bug/[0-9]* . For now run:
90 for file in $dir/$suite/docs
/gtkdoc-
*.log
; do
91 # skip this in verbose mode as we'll have more text
92 if test "x${V}" = "x1"; then
97 # adjust for known files
98 if test $file = "$dir/bugs/docs/gtkdoc-mkdb.log"; then
101 if test $file = "$dir/gobject/docs/gtkdoc-fixxref.log"; then
106 # if there is no /usr/share/gtk-doc/html/gobject we should skip fixxref logs
107 if test ! -d "$GLIB_PREFIX/share/gtk-doc/html/gobject"; then
113 lines
=`grep -v -x -G -e "$DISCARD_PATTERN" $file | wc -l | cut -d' ' -f1`
114 if test $lines -gt $expected_lines; then
115 echo 1>&2 "expected no more than $expected_lines log line in $file, but got $lines"
119 if test $nok -gt 0 ; then failed
=`expr $failed + 1`; fi
120 tested
=`expr $tested + 1`
122 # check stability of generated xml/html
124 for path
in $dir/$suite/docs
*; do
125 if test -d $path/xml.ref
; then
126 diff -u $path/xml.ref
$path/xml
127 if test $?
= 1 ; then
128 echo 1>&2 "difference in generated xml for $path"
132 if test -d $path/html.ref
; then
133 diff -u $path/html.ref
$path/html
134 if test $?
= 1 ; then
135 echo 1>&2 "difference in generated html for $path"
140 if test $nok -gt 0 ; then failed
=`expr $failed + 1`; fi
141 tested
=`expr $tested + 1`
145 successes
=`expr $tested - $failed`
146 rate
=`expr 100 \* $successes / $tested`;
147 echo "$rate %: Checks $tested, Failures: $failed"