From 27abbbb372fee84e6be4018cede1efd45355a6d1 Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Fri, 23 Aug 2013 22:52:07 +0200 Subject: 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. --- tests/Makefile.am | 10 ++++++---- tests/test_manpages.sh | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 4 deletions(-) create mode 100755 tests/test_manpages.sh (limited to 'tests') diff --git a/tests/Makefile.am b/tests/Makefile.am index 22c454a..8444d0e 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -19,7 +19,8 @@ # 02110-1301 USA TESTS = test_dict test_set test_tio test_expr test_getpeercred test_cfg \ - test_myldap.sh test_common test_nsscmds.sh test_pamcmds.sh + test_myldap.sh test_common test_nsscmds.sh test_pamcmds.sh \ + test_manpages.sh if HAVE_PYTHON TESTS += test_pycompile.sh test_pylint.sh test_pynslcd_cache.py endif @@ -30,9 +31,10 @@ check_PROGRAMS = test_dict test_set test_tio test_expr test_getpeercred \ test_cfg test_myldap test_common \ lookup_netgroup lookup_shadow -EXTRA_DIST = nslcd-test.conf test_myldap.sh test_nsscmds.sh test_pamcmds.sh \ - test_pycompile.sh test_pylint.sh pylint.rc in_testenv.sh \ - test_pamcmds.expect usernames.txt test_pynslcd_cache.py +EXTRA_DIST = nslcd-test.conf usernames.txt in_testenv.sh test_myldap.sh \ + test_nsscmds.sh test_pamcmds.sh test_pamcmds.expect \ + test_manpages.sh \ + test_pycompile.sh test_pylint.sh pylint.rc test_pynslcd_cache.py CLEANFILES = $(EXTRA_PROGRAMS) 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" -- cgit v1.2.3