diff options
| author | Arthur de Jong <arthur@arthurdejong.org> | 2013-08-23 22:52:07 +0200 |
|---|---|---|
| committer | Arthur de Jong <arthur@arthurdejong.org> | 2013-08-23 23:46:16 +0200 |
| commit | 27abbbb372fee84e6be4018cede1efd45355a6d1 (patch) | |
| tree | b8d05683f54015630bfc8da5a556d0239cce852f /tests/test_manpages.sh | |
| parent | 494833d674e6d3e2bf251c666a29d752515a6989 (diff) | |
Add a test for the manual pages
This replaces e0491d2 to run xmlto from the man directory. This handles
the case more gracefully if xmlto is not available.
Diffstat (limited to 'tests/test_manpages.sh')
| -rwxr-xr-x | tests/test_manpages.sh | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/tests/test_manpages.sh b/tests/test_manpages.sh new file mode 100755 index 0000000..d302070 --- /dev/null +++ b/tests/test_manpages.sh @@ -0,0 +1,47 @@ +#!/bin/sh + +# test_manpages.sh - run some validity checks on the manual pages +# +# Copyright (C) 2013 Arthur de Jong +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301 USA + +set -e + +# find manual page directory +srcdir="${srcdir-`dirname "$0"`}" +top_srcdir="${top_srcdir-${srcdir}/..}" + +# if xmlto is missing, ignore +if ! xmlto --version > /dev/null 2> /dev/null +then + echo "xmlto not found" + exit 77 +fi + +# set up a temporary directory +tmpdir="test_manpages.tmp" +mkdir "$tmpdir" + +# generate HTML for all manual pages +for man in $top_srcdir/man/*.xml +do + echo "xmlto $man" + xmlto xhtml-nochunks -o "$tmpdir" "$man" +done + +# clean up +rm -rf "$tmpdir" |
