From 53de4aeec5f9b17013060523227afc2c8396462a Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Wed, 27 Jun 2018 12:32:27 +0200 Subject: [PATCH] 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. --- test-tool/Makefile.am | 12 +++++++++- test-tool/libguestfs-test-tool.pod | 8 +++---- test-tool/test-libguestfs-test-tool-docs.sh | 25 +++++++++++++++++++++ 3 files changed, 40 insertions(+), 5 deletions(-) create mode 100755 test-tool/test-libguestfs-test-tool-docs.sh diff --git a/test-tool/Makefile.am b/test-tool/Makefile.am index 2cbd4d1b1..e44fa8943 100644 --- a/test-tool/Makefile.am +++ b/test-tool/Makefile.am @@ -17,7 +17,9 @@ 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 man_MANS = libguestfs-test-tool.1 @@ -56,5 +58,13 @@ stamp-libguestfs-test-tool.pod: libguestfs-test-tool.pod $< touch $@ +# Tests. + +TESTS_ENVIRONMENT = \ + $(top_builddir)/run --test + +TESTS = \ + test-libguestfs-test-tool-docs.sh + check-valgrind: $(top_builddir)/run --test @VG@ ./libguestfs-test-tool diff --git a/test-tool/libguestfs-test-tool.pod b/test-tool/libguestfs-test-tool.pod index e1f7b673f..d4034a038 100644 --- a/test-tool/libguestfs-test-tool.pod +++ b/test-tool/libguestfs-test-tool.pod @@ -39,19 +39,19 @@ L website. 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 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 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 seconds. The default is 600 seconds (10 minutes) which does not usually need to be adjusted. diff --git a/test-tool/test-libguestfs-test-tool-docs.sh b/test-tool/test-libguestfs-test-tool-docs.sh new file mode 100755 index 000000000..234a1408f --- /dev/null +++ b/test-tool/test-libguestfs-test-tool-docs.sh @@ -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=-?