* [BTRFS-PROG][PATCH 7/7] Test for man page
@ 2011-11-02 21:23 Goffredo Baroncelli
0 siblings, 0 replies; only message in thread
From: Goffredo Baroncelli @ 2011-11-02 21:23 UTC (permalink / raw)
To: linux-btrfs
[-- 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 --]
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2011-11-02 21:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-02 21:23 [BTRFS-PROG][PATCH 7/7] Test for man page Goffredo Baroncelli
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox