tests: Add script to check documented tool options match actual options.

podcheck.pl is run as part of the tests to perform various checks on
the documentation and the tool.

Currently we check only that the documented options matches the
options that the tool implements and vice versa.  This commit would
also allow us (in future) to check --help, --long-options,
--short-options, --version output.

This commit includes scripts to run the tests and various fixes to the
manual pages to ensure that the tests pass.
This commit is contained in:
Richard W.M. Jones
2016-07-16 20:52:49 +01:00
parent 1fa3bf14e5
commit 08e27451a6
51 changed files with 859 additions and 141 deletions

View File

@@ -19,6 +19,7 @@ include $(top_srcdir)/subdir-rules.mk
EXTRA_DIST = \
test-virt-diff.sh \
test-virt-diff-docs.sh \
virt-diff.pod
CLEANFILES = \
@@ -82,8 +83,11 @@ stamp-virt-diff.pod: virt-diff.pod
TESTS_ENVIRONMENT = $(top_builddir)/run --test
if ENABLE_APPLIANCE
TESTS = \
test-virt-diff-docs.sh
if ENABLE_APPLIANCE
TESTS += \
test-virt-diff.sh
endif ENABLE_APPLIANCE

23
diff/test-virt-diff-docs.sh Executable file
View File

@@ -0,0 +1,23 @@
#!/bin/bash -
# libguestfs
# Copyright (C) 2016 Red Hat Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
export LANG=C
set -e
$srcdir/../podcheck.pl virt-diff.pod virt-diff \
--ignore=--checksums,--dir-link,--dir-nlink,--dir-nlinks,--dir-time,--extra-stat,--time,--uid,--xattr