All of lore.kernel.org
 help / color / mirror / Atom feed
From: Goffredo Baroncelli <kreijack@inwind.it>
To: linux-btrfs@vger.kernel.org
Subject: [BTRFS-PROG][PATCH 7/7] Test for man page
Date: Wed, 02 Nov 2011 22:23:49 +0100	[thread overview]
Message-ID: <2290721.F2lPLrcd0v@venice> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 1373 bytes --]

This test checks that the man page cites all the btrfs commands

Comments are welcome.

BR
G.Baroncelli

Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it>
---
 test/003s.sh |   40 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 40 insertions(+), 0 deletions(-)
 create mode 100755 test/003s.sh

diff --git a/test/003s.sh b/test/003s.sh
new file mode 100755
index 0000000..b47bfb8
--- /dev/null
+++ b/test/003s.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+. test/functions.sh
+
+# to avoid an unneeded losetup execution
+BTRFS_TESTS_VOLUMES=""
+
+announce manpage
+catchclean
+
+cmds="$( ./btrfs | grep "^$(echo -ne \\t)btrfs" | grep -v help | 
+		while read line; do
+			set $line
+			# restripe commands have 4 verbs, 
+			# the other commands have 3 only verbs
+			if [ "x$3" = "xrestripe" ]; then
+				echo "$1,$2,$3,$4"
+			else
+				echo "$1,$2,$3"
+			fi
+		done
+
+)"
+
+function check_command(){
+	tot="$(man man/btrfs.8.in | grep -E "$1" | wc -l )"
+	[ "$tot" -ge 2 ]
+}
+
+for cmd in $cmds; do
+
+	recmd="$( echo $cmd | sed -e "s/,/[[:space:]]+/g" )"
+	vcmd="$( echo $cmd | sed -e "s/,/ /g" )"
+	
+	catch check_command "$recmd" || \
+		fail Command "'$vcmd'" not present in man page
+
+done
+
+summarise

-- 
gpg key@ keyserver.linux.it: Goffredo Baroncelli (ghigo) <kreijack@inwind.it>
Key fingerprint = 4769 7E51 5293 D36C 814E  C054 BF04 F161 3DC5 0512

[-- Attachment #1.2: send-via-kmail-attach-12137-1320267578-27114.msg --]
[-- Type: text/x-patch, Size: 911 bytes --]

diff --git a/test/003s.sh b/test/003s.sh
new file mode 100755
index 0000000..b47bfb8
--- /dev/null
+++ b/test/003s.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+. test/functions.sh
+
+# to avoid an unneeded losetup execution
+BTRFS_TESTS_VOLUMES=""
+
+announce manpage
+catchclean
+
+cmds="$( ./btrfs | grep "^$(echo -ne \\t)btrfs" | grep -v help | 
+		while read line; do
+			set $line
+			# restripe commands have 4 verbs, 
+			# the other commands have 3 only verbs
+			if [ "x$3" = "xrestripe" ]; then
+				echo "$1,$2,$3,$4"
+			else
+				echo "$1,$2,$3"
+			fi
+		done
+
+)"
+
+function check_command(){
+	tot="$(man man/btrfs.8.in | grep -E "$1" | wc -l )"
+	[ "$tot" -ge 2 ]
+}
+
+for cmd in $cmds; do
+
+	recmd="$( echo $cmd | sed -e "s/,/[[:space:]]+/g" )"
+	vcmd="$( echo $cmd | sed -e "s/,/ /g" )"
+	
+	catch check_command "$recmd" || \
+		fail Command "'$vcmd'" not present in man page
+
+done
+
+summarise


[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 190 bytes --]

                 reply	other threads:[~2011-11-02 21:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2290721.F2lPLrcd0v@venice \
    --to=kreijack@inwind.it \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.