test-tool: add a documentation test

Add the podcheck.pl test, to make sure the documentation is in sync with
the available options.

Also fix the formats of options in the current POD, so it matches what
used already in other documentations, and what podcheck.pl expects.
This commit is contained in:
Pino Toscano
2018-06-27 12:32:27 +02:00
parent 5565cf767a
commit 53de4aeec5
3 changed files with 40 additions and 5 deletions

View File

@@ -17,7 +17,9 @@
include $(top_srcdir)/subdir-rules.mk include $(top_srcdir)/subdir-rules.mk
EXTRA_DIST = libguestfs-test-tool.pod EXTRA_DIST = \
libguestfs-test-tool.pod \
test-libguestfs-test-tool-docs.sh
bin_PROGRAMS = libguestfs-test-tool bin_PROGRAMS = libguestfs-test-tool
man_MANS = libguestfs-test-tool.1 man_MANS = libguestfs-test-tool.1
@@ -56,5 +58,13 @@ stamp-libguestfs-test-tool.pod: libguestfs-test-tool.pod
$< $<
touch $@ touch $@
# Tests.
TESTS_ENVIRONMENT = \
$(top_builddir)/run --test
TESTS = \
test-libguestfs-test-tool-docs.sh
check-valgrind: check-valgrind:
$(top_builddir)/run --test @VG@ ./libguestfs-test-tool $(top_builddir)/run --test @VG@ ./libguestfs-test-tool

View File

@@ -39,19 +39,19 @@ L<http://libguestfs.org/> website.
Display short usage information and exit. Display short usage information and exit.
=item B<--qemu qemu_binary> =item B<--qemu> qemu_binary
If you have downloaded another qemu binary, point this option at the If you have downloaded another qemu binary, point this option at the
full path of the binary to try it. full path of the binary to try it.
=item B<--qemudir qemu_source_dir> =item B<--qemudir> qemu_source_dir
If you have compiled qemu from source, point this option at the source If you have compiled qemu from source, point this option at the source
directory to try it. directory to try it.
=item B<-t N> =item B<-t> N
=item B<--timeout N> =item B<--timeout> N
Set the launch timeout to C<N> seconds. The default is 600 seconds Set the launch timeout to C<N> seconds. The default is 600 seconds
(10 minutes) which does not usually need to be adjusted. (10 minutes) which does not usually need to be adjusted.

View File

@@ -0,0 +1,25 @@
#!/bin/bash -
# libguestfs
# Copyright (C) 2018 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.
set -e
$TEST_FUNCTIONS
skip_if_skipped
$top_srcdir/podcheck.pl libguestfs-test-tool.pod libguestfs-test-tool \
--ignore=-?