summaryrefslogtreecommitdiff
path: root/tests/tools.sh.in
blob: 343844a5aafa6dd56a019bcd3472281424d2d739 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/sh

suite="tools"

failed=0
tested=0

echo "Running suite(s): gtk-doc-$suite";

# we use 'which' here as we override the path in TEST_ENVIRONMENT


# test shell scripts
for file in gtkdocize; do
  sh -n `which $file`
  if test $? != 0 ; then failed=`expr $failed + 1`; fi
  tested=`expr $tested + 1`
done


# test xsl files
for file in $ABS_TOP_SRCDIR/*.xsl; do
  xmllint --noout --noent $file
  if test $? != 0 ; then failed=`expr $failed + 1`; fi
  tested=`expr $tested + 1`
done


# test python scripts
# TODO: also test the module files
for file in gtkdoc-check gtkdoc-depscan gtkdoc-fixxref gtkdoc-mkdb gtkdoc-mkhtml gtkdoc-mkhtml2 gtkdoc-mkman gtkdoc-mkpdf gtkdoc-rebase gtkdoc-scangobj; do
    fullfile=`which $file`
    @PYTHON@ -m py_compile $fullfile
    if test $? != 0 ; then failed=`expr $failed + 1`; fi
    tested=`expr $tested + 1`
done


# summary
successes=`expr $tested - $failed`

rate=`expr 100 \* $successes / $tested`;
echo "$rate %: Checks $tested, Failures: $failed"

test $failed = 0
exit $?