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