diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2008-01-28 21:02:44 -0500 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2008-01-28 21:02:44 -0500 |
commit | fd5dfedbb75593539eeda92013042ce5423a65c4 (patch) | |
tree | aaf08531db4fe4884cf673dbb3bfa39463adb22b /doc/public/check-doc-coverage.sh | |
parent | c133ee5acc7c97fcd43d61f5aad160ca96c47941 (diff) |
[doc/public/check-doc-coverage.sh] Test that doc coverage is 100%
Yay!
Diffstat (limited to 'doc/public/check-doc-coverage.sh')
-rwxr-xr-x | doc/public/check-doc-coverage.sh | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/doc/public/check-doc-coverage.sh b/doc/public/check-doc-coverage.sh new file mode 100755 index 000000000..986af6d8f --- /dev/null +++ b/doc/public/check-doc-coverage.sh @@ -0,0 +1,43 @@ +#!/bin/sh + +LANG=C +if test -z "$DOC_MODULE"; then + # extract from Makefile + eval `grep '^DOC_MODULE' Makefile | sed 's/ //g'` + if test -z "$DOC_MODULE"; then + echo Failed extracting DOC_MODULE from Makefile 1>&2 + echo Try setting DOC_MODULE env var manually 1>&2 + exit 1 + fi +fi + + +test -z "$srcdir" && srcdir=. +status=0 + +if ! test -f "$DOC_MODULE-undocumented.txt" -a -f "$DOC_MODULE-unused.txt"; then + echo At least one of "$DOC_MODULE-undocumented.txt" and "$DOC_MODULE-unused.txt" not found. + echo Skipping test. + exit 0 +fi + +status=0 + +if test -f "$DOC_MODULE-unused.txt"; then + unused=`cat "$DOC_MODULE-unused.txt"` + if test -n "$unused"; then + echo Unused documentated symbols: 1>&2 + cat "$DOC_MODULE-unused.txt" 1>&2 + status=1 + fi +fi +if test -f "$DOC_MODULE-undocumented.txt"; then + if ! grep '^0 symbols incomplete' "$DOC_MODULE-undocumented.txt" >/dev/null || + ! grep '^0 not documented' "$DOC_MODULE-undocumented.txt" >/dev/null; then + echo Incomplete or undocumented symbols: 1>&2 + cat "$DOC_MODULE-undocumented.txt" 1>&2 + status=1 + fi +fi + +exit $status |